ok i'm working on my second tower defence game now
this time i was planning to add a slow tower too
i have a datascource where i keep a speed multiplier and it works
however if i want to change it dyamicly when the enemy is already moving
the problem here is that this will cause the enemy to stop following the path anymore, it would overshoot corners etc
the movement is now just a chain of delay, state, delay, state etc
the delay make sure it corners at the right time and the state events enables a interval trigger that make the enemy turn in a limited amount of impulses
the problem is that the delay filters duration and maybe the amount of ticks mess up when its changed dynamicly.
so any ideas on how this maybe can be solved would be nice
i have thought about using a second delay that keeps track of how long it has been slowed etc. but didn't really think on how i'll do that practicly
Sounds like you'll have to forget delays and use coordinates and filters instead if you can.
would using an impulse clamp and dynamically adjust the max received work.
i tried with doubling the delays and got it to work but i had to add a few things to much to my likeing
gonna look if i can reduce the added coding because its way to much now
adding the slow would almost double this code or even more
you have an idea on how to make the movement with the filters? i need to have it as small as posible.
i managed to make the movement now about 60 tiles big and the enemy takes 13 corners and goes up and down a bridge
i only use 1 impulse for the delay, state event chainOriginally Posted by dasraiser
You're making an enemy move in a spline like movement? Maybe the coding to my car animations might help you. Are you using local or global movement? If the latter, I would suggest trying local.
I had one data source that increased constant, but interjected a curve datasource when making it move in a curve pattern. That was just enabled in a timely manner using delay filter, and state on event. Sounds like what you need? I could be wrong.
@jarr, now if you can make it move slower(at a random moment) and still let it follow the same path
first i was using global movement with curved datascources but the coding was way to big and started producing alot of lag while trying to copy paste it for several enemy's, global was used at first because it was easier to teleport the back to the starting position
curved datascources didn't work at all for changing the speed while they are active because that would cause the enemy to teleport to other locations when changing the duration
as for some requirements
-code needs to be small
-only speed reduction is needed
-slow is instant at a random time
If you want it to be slow for a moment, why not use a separate OPE? ie have two vs a single OPE. Turn off the main OPE, then turn on 2nd OPE, then turn back on the 1st OPE. The 2nd OPE would have a curved data source that moves at a slower rate of increase.
I have to go to work now, but I can help later if I'm online, hit me up![]()
You definitely need to switch from using delays to generic filters to make it turn when it reaches the coordinates. It will turn in the exact same spot no matter the speed. For the speed, just change the value of a curved data source using a set value event.
Oh thats a nice idea! Try that.....you bobo genius lolOriginally Posted by bobozilla