Lunatrap's Forum Posts

  • well, i think he is reffering to a chess game without AI

    in that case i think is possible... but not easy

  • well actually as far as i cant tell, a AI that plays chess its really hard... i dont think is doable, unless you use some extrange algorithm, i dont think is possible with standar knowlegde

  • Lunatrap Thanks that actually worked fr me.

    I didnt think of using a variable to track another variable then just have it reset once a condition is met.

    Thanks for showing me this method and taking the time to write it out.

    no problem, im glad i can help =)

  • do this... =)

    look at the picture below.

    just susbtitute the name "layout6" with your layout's name

    haz esto... =)

    solo substituye el numbre del "layout6" por el tuyo

    mira la imagen de abajo.

    i think this should work

    if you dont find the layout name condition, im using the "compare two valuables" condition, and you compare it to the system expression "layout name" and set it to is = remember that to compare it with a string (letters) you need to add "" commas.

  • > maybe this fixes your problem?

    >

    yes its a lot simpler, the only problem i see is, when i dont move the enemy shakes, instead of staying still, any advice?

    use the platform behaviour and do this

    if player.x is greater (>) than enemy.x then -> simmulate control pressing right

    if player.x is lesser (<) than enemy.x then -> simmulate control pressing left

    to eliminate any kind of odd behaviour like the enemy geting to the same X as player and starting to freak out you should do this

    if player.x is greater (>) than enemy.x +20 then -> simmulate control pressing right

    if player.x is lesser (<) than enemy.x -20 then -> simmulate control pressing left

    im not sure about the +20 and -20 if it looks odd switch them around...

  • how aobut having a separate variable that add+1 every time that the main varialbe adds+1

    SO when the second variable gets to a number, you reset it back to 0 and then respawn enemies =)

    like this

    if player collects 1 coin

    then*add+1 to "# of coins" variable

    *add+1 to "# of coins to respawn enemy" variable

    when "# of coins to respawn enemy" variable is = to 10 or >

    then* set varaible "# of coins to respawn enemy" to 0

    *respawn enemy at ???.X & ???.Y

    does this work for you??

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

  • 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!!!!!