Lunatrap's Recent Forum Activity

  • I'm 90% sure I read recently that Trigger Once doesn't work with instance variables. How about setting Dead=2 when Dead=1 is processed.

    Edit: add Dead=0 to your HP<=0 test

    Edit: or just HP<=0 & Dead=0 ->Dead=1, Set animation...

    yeah, that seems to work, but i see it as a very bad solution, since having to change the variable jsut to make a trigger once... seems very cumbersome, i think ashley should add a condition like that replaces this method

    thanks to both of you guys =)

  • im having problems... i still cant figure this out

    i have this enemy that when its hp os = or > to 0 then set dead cariable to 1

    then if dead is = 1 set the death animation

    but if i set it to trigger once, it will trigger the animation only for the first enemy that dies...

    and if i set it without the trigger once it will play the animation every tick... so it wont play :/

    is there some condition or somethign that could solve this problem??

  • You can use variable like this:

    For each sprite,

    - if instance variable A is 0, set instance variable A to 1 and execute some codes further.

    This will make the code above executed once for each instance when its instance variable is 0. Set instance variable to 0 again somewhere for a particular instance to have the event run this part again for that particular instance.

    Don't use "trigger once". If my memory is correct, it is not applicable in for each loop.

    Actually... can you tell us your big picture? What are you trying to do?

    not sure whether this will help you.

    mmmm what you are saying makes a lot of sense... i will try it and report the results

  • hi guys

    im having rpoblems figuring this one out

    how can make an event where a condition is triggered once for every instance, using instance variables as conditions, if i use trigger once it will trigger only once for one of the instances... so it does not work

    i have tried many methods, but i cant figure it out

    this is useful becuase les say that i want to tell a instance, that when its instance varialbe is true to start a timer or something that requires to be triggered once... what do you reccomend??

    you can see what im triying to do in the picture below

    thanks a lot

  • Here is a capx with a few different methods:

    https://dl.dropboxusercontent.com/u/542 ... annon.capx

    The first method uses a fixed speed and finds an angle. The angle is NaN if there is no solution.

    The second uses a fixed angle and finds a speed. The angle is NaN if there is no solution.

    The third is like the second but the angle is always pointed above the target so there always is a solution.

    Finally the bullet behavior wasn't used since the path isn't accurate when using gravity.

    i will check it out =) thanks a lot...and report findings

    btw your plugins are awesome... and many of my game's features could not be possible wihtout you =) thanks

    you surely will appear in my game with other user that are so firendly and helpful XD

  • Hi guys... i was wondering if you could lend me some of you wisdom in the fiel of mathematics and C2

    im looking for a bullet that will travel in a parabolic way (like castlevania's skeletons)... and hit the player, but not ramdom, but with precision (see the picture attached) i can make a parabolic bullet but i cant do it that it will always fall where the players is... so if he does not moves it will hit him.

    how do you do it??? 0:

    another thing if its possible to implement this to make enemies jump in a parabolic trajectory and fall in the player... that would be awesome...

    thanks in advance, any help will be appreciated

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ignore the last one - this is even better. It uses a for-loop to set the timer value at the start of the layout according to the instance variable you set (better for editing in the layout view).

    thanks a lot =) i will check it out and report my findings

    Update... Thanks a lot it looks and works great!!

  • hi guys =)

    i ned you help and i will appreciate it

    see... i have this hammers that come down and crush the player..

    but... what i want them to do... is to every hammer to have their own timer to time when whey will axecute a code instead of doing it at the same time... i tried doing it with a instance variable... but, still i does not look good, if you pay attention the left one has 1.5 s of time and the right one has 6 but they only wait once and then they take the same time to go up and down

    another problem i have with my exmaple is that if you pay attention when the hammer go up... and hit the limit... they are supposed to totally stop but, for some reaosn the keep going up slowly, i dont know why they do that... so i will appreciate if you could help me here aswell

    can you give me a hand with this?? check out the .capx below

    im planing to do... disappering platforms (like in the classic megamans) but before that i need to resolve the time problem..

    thanks for any help =)

  • OK, I looked in to this a bit more carefully and think I might have found the cause. Instead of doing a full new release can anyone affected by different trigger behavior try the following:

    1. Download https://dl.dropboxusercontent.com/u/15217362/r167-fix.zip

    2. Extract to <install directory>\exporters\html5, replacing the eveng.js and preview.js files already there

    3. Restart Construct 2

    4. Test again and see if fixed

    Let me know if that resolves the issue.

    i will do it ashley, and report the results ASAP thanks!!!

    UPDATE:

    IT WORKED!!! IT WORKED!! YEEEES!! thanks a lot ashley!!! you are a god among men

    now my triggers are working as intended and everything is back to normal thanks!!!!!

  • Lunatrap - if it's just one keyboard event that's triggering twice, can you reproduce it in a new empty project? If there's a problem we can probably fix it immediately off the back of that, but without it we might not be able to get anywhere.

    no just one... a lot... pretty much all my keyboard events...

    i cant reproduce it... with a simple event sheet it does not happen...

    you can argue that its an error in my code... but like i said... everything works well on r165... if i unistall r165 and install 166/167 (free version) and then it wont work (repeat this about 10 times to be sure), that means that there is nothing wrong with my code... something changed with C2 on r166

    my project is too big to export to an empty peoject... it will take me days or weeks to do it...

    i guess its better to send you my .capx instead.

    i would not be so worried like i am now... if i could stay in r165 and finish my game... but since i have the steam version i cant go back to r 165... so i need your help very bad :/

  • Can anyone confirm that r167 has fixed it?

    sadly, no... i still expirience the same problems :/

    there is one weird thing... my problem seen to be with the keyboard plugin... its triggering twice, but i have the exact same event, but for triggering with the gamepad... and they seem to be fine...

    plase help... :/

    the worse thins is to pin point exactly what is causing the problem... but i suspect of

    the condition "layes is visible" inverted or not...

    it seems that all the events that no longer work, is becuase they use this condition...but the wrid thing is that with the gamepad... this one, trigger fine... :/ im confused

  • Ldk thanks for this, i will take a closer look when i'm free and post an update here again.

    Lunatrap it was suggested by another user here as i want the enemy to chase the player, the enemy has both platform and pathfinding behaviour in them. Do you have a better way to just use platform behaviour and have the enemy chase the player too?

    pathfinding is not neccesary, it will just take CPU power and it reacts very slowly...

    here you go...very basic, i hope you can add more... like jump and more...

Lunatrap's avatar

Lunatrap

Member since 12 Jul, 2013

None one is following Lunatrap yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies