TwinBlazar's Recent Forum Activity

  • You can open as many projects as you want in C2. But to be frank, to avoid confusion, you should open only just 1-2 projects at a time.

    About opening many instances of C2 simultaneously, lets wait for the creators to answer this.

  • Add a check in your event sheet. If damage is less than 1, reduce HP by 1. Else, reduce HP by attack - defense.

  • Could you please elaborate further? I'm not sure if I understand your real intention correctly.

  • But still, I am not sure whether this is overkill for you or not.

    The good thing is, if you implement an event sheet for this, all you need to do, is simply relate new object types to string with nickname plugin when you got a new item type and just modify "chance" and "drop" variables as you wish, for the rest of your project.

  • And one more thing, I prefer to have all the numbers to be in 100 range. That way, it's more like 0-100% to me. Sure, mathematician might slap at me for this, but hey, this chance implementation thing is entirely up to you.

  • Now, you are talking about workflow. ;)

    What I suggested you is a very simple idea, but in order to be efficient and flexible in the future, you will need something else.

    If I were you, I will store which enemy drops which item in 2 instance variables called "drop" and "chance". All enemies will be in one single family and that "droppingItem" family will have these 2 instance variables IN string. WHY in string?

    Because I will store it like this:

    drop = "None|Potion|Antidote"

    chance = "60|30|10"

    Now, when an enemy got killed, it's time to do some string parsing. First, get this instance variable. Parse the string using tokenat expression:

    okenat(src, index, separator)

    Return the Nth token from src, splitting the string by separator. For example, tokenat("apples|oranges|bananas", 1, "|") returns oranges.

    tokenat(drop, 0, "|") shall return "None".

    tokenat(drop, 1, "|") shall return "Potion".

    tokenat(drop, 2, "|") shall return "Antidote".

    tokenat(chance, 0, "|") shall return "60".

    tokenat(chance, 1, "|") shall return "30".

    tokenat(chance, 2, "|") shall return "10".

    Yes, you will put this in a loop and using loopindex instead of 0,1,2. (if you want more technical info here, ask the forums regarding the loop in C2)

    Now, you will want to check your random value against the chance value. Perhaps, with this:

    okencount(src, separator)

    Count how many tokens occur in src using separator. For example, tokencount("apples|oranges|bananas", "|") returns 3.

    The pseudocode will be something like this: (if you never write a program before, just say so)

    ran = random(100);
    
    while ( tokencount(chance, "|") > loopindex){
      
      if ( int(tokenat(chance, loopindex, "|")) < ran)
        return tokenat(drop, loopindex, "|");
    
      loopindex = loopindex + 1; 
    }

    Now, with this here, you will get yourself one of the "None|Potion|Antidote". So how can you create an object type respectively? You need to use a plugin called "nickname" for this. Search for it in the forums. It allows you to create object via string.

    This sounds complicated, but this is one possibility.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Random expression and the event "is in range" will be your friend here. These two features, not sure the name for the latter is correct, exist and you will use them here.

    For example, you could have a global variable "ran" to store a random value and have something like this for item dropping logc in your event sheet:

    set global variable "ran" to random(100)

    is "ran" in range 0 to 90 : drop item 1

    is "ran" in range 90 to 100 : drop item 2

    Here is an example of item dropping. Common item 1 has 90% chance of being dropped while the rare item 2 has only 10% chance of being dropped.

  • For the sound, please do a search on tutorial section on beginner guide to sound. Also, Construct 2 is platform independent, so no need to worry about platform difference.

    For the name, please refer to the manual on global variable. But to make the player typing their name in, we need some workaround right now, I believe. Do a search on text box in this forums.

  • create all the pieces together, at the same time?

    I don't understand what do you mean there. Please elaborate.

  • I would highly recommend you to create your animation using other programs such EDGE 2, Graphics Gale, etc. These programs are made specifically for such animation making. They have layer management, etc. Sure, you have to export them and then import them to C2, but if C2 is going to support onion skin, usability-wise, it will need some of the useful tools for better workflow as well. Or else, having just the onion skin ain't worth it, in my opinion.

    Also, you can modify your images with those animation program right in the project directory, no?

  • I am using function for player's movement, as you can see here:

    <img src="http://img547.imageshack.us/img547/5989/capturenn.png" border="0" />

    So far, I don't see any problem.

    But then, I came across this: scirra.com/tutorials/510/advanced-tips-and-tricks-that-construct2-offers , which is published on 31st, March 2013. My concern is from this statement:

    ust be sure to not call functions each tick ... or you'll get Javascript errors ;)

    While, for my case, I do not invoke function in every tick. I have to admit I exploit function calls to a very great extent. In fact, my whole event sheet rather looks more like programming code.

    But so far, I do not see any problem. Everything works accordingly. Has anyone got some sort of such Javascript errors here? How stable is the function calling in C2?

TwinBlazar's avatar

TwinBlazar

Member since 14 Apr, 2013

Twitter
TwinBlazar has 1 followers

Connect with TwinBlazar

Trophy Case

  • 11-Year Club

Progress

11/44
How to earn trophies