aruche's Forum Posts

  • Maybe you could do:

    Dictionary -> Destroy

    System -> Create object [Dictionary]

    for a quick but dirty way to 'reset' the values.

  • Try something like:

    "https://twitter.com/intent/tweet?text=Here+is+my+Score:+" & SCORE

    The '&' operator joins 2 variables or text together.

    if SCORE is 1337, the concatenated text will be: "https://twitter.com/intent/tweet?text=Here+is+my+Score:+1337"

  • Hi,

    have you tried using "On collision with Exit" instead of "Is overlapping Exit? "Is overlapping" condition triggers like every tick thus the "game over" sound is repeated many times.

    Regards,

    Aruche

  • Okay I'll forget about the idea then.

    Thanks for clarifying! :)

  • Hi all,

    I'm developing a Behavior that has an Action which will narrow down the selected instances (of the object with that behavior) by comparing some parameters and properties. The problem I have is that the SOL does not reset to select_all after an Event block.

    e.g.

    -> Every Tick

    --> [Action] Sprite | Pick instances where Property value is "Parameter value" #Selects 1 sprite.

    -> Every Tick

    --> [Action] Sprite | Set X to Sprite.X + 50 * dt

    Expected result:

    • All sprite objects to move.

    Actual result:

    • Only the selected sprite object moves. (It stays that way until another condition picks all of the object type)

    However, it works as intended if I simply add an object parameter to the action (even without modifying the runtime code to use the object type).

    Any ideas? (Is it actually OK to change the SOL of an object type through an action?)

    Thanks!

  • I don't have a solution for this.. would like to give it a try at explaining the issue.

    The "return" statement of usual programming / scripting languages allows the program to exit from a function call at any point in the function.

    A simple application of the return statement is in a search function, we would want to exit the function once we found the object that we are searching for. Since there's no "return" statement in Construct2's function object, a working but bulky solution would be to keep a variable for e.g. "done" to keep track of the completion of a task. The code becomes bulky, looks more complex the more points of exit there are. Forgetting one check for the "done" variable can mean a lot of time spent debugging.

    A pseudo code (in a script language like Javascript) of a function to illustrate the issue:

    var globalVar1 = 0;
    function foo(){
       ...
       while(someCondition ){
         ...
         if( someCondition ) 
            return something;
         while(someCondition ){
            ...
            if( someCondtion ){
                return something;
            }
            globalVar1++;
         }
       }
    }
    

    Pseudo code for the same function in Construct 2:

    global var globalVar1  = 0;
    function fooC2(){
      ...
       <font color=orange>local variable done = 0;</font>
       while(someCondition <font color=orange>AND done = 0</font>){
         ...
         if( someCondtion ){
             function -> set return value = something;
             <font color=orange>done = 1;</font>
         } 
         while( someCondition <font color=orange>AND done = 0</font>){
            ...
            if( someCondition ){
               function -> set return value = something;
               <font color=orange>done = 1;</font>
            }
            if(<font color=orange>done = 0</font>){
               globalVar1 = globalVar1 +1;
            }
         }
      }
    }
    

    Sorry that I couldn't think of a better example, but I remember having this issue too. It doesn't make it impossible to get the same output, but it makes the code bulky.

  • Hi, hope this will help :)

    • [Cond.] On I pressed, PauseSelect is overlapping BowIcon

    -> [Action] IButtonIcon | Set animation frame to 1

    -> ...

    --> [Cond.] IButtonIcon Animation frame = 1

    ---> [Action] IButtonIcon | Set AssignedItemSwitch to 1

    --> [Cond.] IButtonIcon Animation frame = 2

    ---> ...

    ...

    IButtonIcon Animation frame is changed to 1 before the value is stored as AssignedItemSwitch.

  • Hi,

    Not sure if this helps..

    https://www.dropbox.com/s/40ef2gwjkmgokmb/HexRGB.capx

  • Awesome stuff, thanks! I needed the "accessToken" value, I'm puzzled why it still isn't in the official plugin yet...

  • IsometricRobot

    is adding a Solid Behaviour to Sprite11 a possible solution? As in that would handle the "stop when collide" and "move when not colliding" issue but would that break something else?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • SingularPixel

    Hmm, I could replicate something like that when the 2nd layout has "Every x Seconds" conditions and it seems like the first occurrence of that event is calculated using the amount of time since the start of the game(instead of from the start of the layout).

    How to replicate:

    Menu layout

    -[Condition] Keyboard-> On key press = Spacebar

    - [Action] System -> Go to game layout

    Game layout

    • [Condition] Every 3 seconds

    - [Action] System -> Spawn tank.

    Scenario:

    • Start the game.
    • Wait 3 seconds or more
    • Press spacebar.

    Observation:

    • First tank is spawned, without 3 seconds countdown.

    I'm not sure if it's the same problem.. but if it is, you could try something like this:

    <img src="http://img211.imageshack.us/img211/8721/97150102.png" border="0" />

  • jeffige

    Hi, I'm not sure if this is what you want:

    http://dl.dropbox.com/u/33370253/TankNBomb.capx

    (Made with r110.2)

    The below condition (highlighted) is what makes the tank shoot a "bomb" only after the other is destroyed.

    <img src="http://img855.imageshack.us/img855/3170/25072164.png" border="0">

    You can disable that condition if you just want a delay between the "bombs".

    Hope that helps..