How To modify the wander behavior for actor turn in the same direction of wander

Tuo

  • *
  • Posts: 2469
Okay, first, I do like your strategy for the min to max times... the multiplying by the float works rather well, so nice going :).

That said, the coding is likely hiccuping due to your use of always statements with delays in them... without extra stoppers, it's trying to do many things at once. Also, since now I have when the movement is set, you won't need my code part from earlier.

I tried to make mine very similar to yours. You will notice that I got by without some of your attributes (like the Move and Wait booleans or your x/y speed numbers) but needed two new ones instead (Angle and RealSpeed, both of which are number attributes).

Use custom events (Add Event -> Advanced -> Custom Event) allows to bypass a lot of your conditionals, saving on lag and possible issues. The collision coding is now angular instead (using two trig identities to change the direction). Each time you set the "point self", you might have to adjust it by 90/180/270... it all depends on your original position of the ant. The code should be solid for you though.

(Remember, if an attribute looks similar to your names, they ARE the same... I just abbreviated some of them.)
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

jdevlearning

  • Posts: 46
IM ON IT LET ME CREATE THIS TO SEE WHAT HAPPENS

jdevlearning

  • Posts: 46
    Ok the game atribs are:

    • start waiting?
                                      !
    • MinWaitTime
                                        !
    • MaxWaitTime
                                                                                         
ARE GETTERS OR SETTERS and
                                                                                    are Booleans or numbers?

  • MinMoveTime
                                   !           
  • Changedirectiononcollision
                  !

[/list]


Is right I just going to create a for this atribs'  to start blocking code :o

« Last Edit: February 07, 2013, 08:56:46 am by jdevlearning »

jdevlearning

  • Posts: 46
Apologies for my silliness but it was expressed already on the wander block code   :P

Tuo

  • *
  • Posts: 2469
The ONLY two new attributes are "Angle" (number) and "RealSpeed" (number). The rest are the same that you were using before (the phrasing of them is slightly off).
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

jdevlearning

  • Posts: 46
Here is the results, but is still buggy, buggy is not walking correctly  :'(
<a href="https://sites.google.com/site/the3dultimatecom/resources/Game_1.flv" target="_blank" class="new_win">https://sites.google.com/site/the3dultimatecom/resources/Game_1.flv</a>

« Last Edit: February 07, 2013, 08:15:56 pm by jdevlearning »

Tuo

  • *
  • Posts: 2469
Your screenshots are not visible, and since you didn't describe the bugs, I don't know how I can help...
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

Tuo

  • *
  • Posts: 2469
I did try to update the coding to see if there were any bugs... the only thing I noticed was some issues with collision acting funky, so here's the updated code to get around that:
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

jdevlearning

  • Posts: 46
Oh tuo im sorry i tried my best to upload the swf file or the movie only i can do download to check the progress. ill gonna find to fix it. I think this post must pinned is very useful for all the ppl

here the movie link:
https://sites.google.com/site/the3dultimatecom/resources/Game.avi?attredirects=0&d=1

And below the swf

« Last Edit: February 07, 2013, 08:20:24 pm by jdevlearning »

Tuo

  • *
  • Posts: 2469
Can't you just tell me what's the issue (and if my updated code fixed it)?
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

jdevlearning

  • Posts: 46
http://community.stencyl.com/index.php?action=dlattach;topic=18995.0;attach=17349
you have now above swf file with the folder preview. Sorry

BTW is the last code you designed, not newly one you created now. just trying to show what happen. Anyway if you have skype we can work fine and avoid any misunderstood by delayed respond.

« Last Edit: February 07, 2013, 08:29:58 pm by jdevlearning »

Tuo

  • *
  • Posts: 2469
I don't have Skype. All of my instant communication is via my livestream (livestream.com/stencyl).

If you are having issues with collisions, try the newer code.
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

jdevlearning

  • Posts: 46
The new code giving the same result the problem is not collisions is the correct walk for the bug, walking to the left but looking up or walking up but looking at 45 degrees. Look and walk never aim in the direction, here is the attachment good friend 8)

l
l
l
v

Meestar

  • Posts: 652
The new code giving the same result the problem is not collisions is the correct walk for the bug, walking to the left but looking up or walking up but looking at 45 degrees. Look and walk never aim in the direction, here is the attachment good friend 8)

l
l
l
v

In the part that says <Point actor towards <Angle>> try adding either 90, 180, or 270 to the angle.
PM me if you require help.  I'm always glad to help out!

captaincomic

  • *
  • Posts: 6109
Do you want the actor to rotate to face it's movement? Then that's what the code Tuo posted does. It is also available as a pre-shipped behavior Face Direction of Movement.

Or do you want to switch animations based on which direction the actor is moving?