So I've been creating a tabletop style strategy game and I'm having a weird issue with spawning units and moving them about.
In a nutshell, I run a loop X amount of times based on Alt Value P of active object Squad 1, which then say creates 10 Unit 1's. (1 per loop, and assigns Alt Values as it goes*)
Another event kicks in which then dictates if they are colliding with another Unit, they pick a random position within a radius to move to.
About half the time, and more commonly with higher population units (there are ten types, each with random pop's from 4-15), a 'ghost' unit will appear and won't stop shifting to new positions, UNTIL I move the Squad 1 object it is moving around.
I have some counters set up to retrieve data for me and such, and the D value of these 'ghost' units is usually around 500 or so. This is the Distance value, and is 'always' set as a mathematical equation that represents the distance between any given unit and it's Squad marker. It is in place so that if a Unit is too far from it's Squad, it will move.
What I think is happening is that the D value of these units is somehow not being affected by the Always command to set it's D to the ACTUAL distance. It is however triggering the command that makes it move it is outside the radius allowed.
So I have no idea what is going on, and I hope that made sense.
NOTES:
*The Loop actually doesn't pass on the command to assign values to the Unit alt values upon spawning. Is this because the event references the Active Object Squad 1, and therefore can only affect said object?
Additionally, only the first 5 Squads have the Collision stuff hooked up, and even then they don't detect collisions with other Unit's yet.
That's a link to my skydrive where I've got the file posted.
Any assistance would be of great help! You guys are genious, each and every one of you, some of the things I've seen you post on the other files are just insane! I've been toying around with this program off and on for YEARS but I still know I have a hell of a lot to learn.
Ok well I fixed the first problem, but the secondary remains...
I'm running the Loop Spawn AIU1 based on Alt Val P of active object Squad 1.
Spawn A1U1 Creates an Object Unit 1, and assigns it some values. However it seems these values aren't being assigned for some reason that I cannot find!
Is this create object action and the assigning of values in the one event line or seperate event lines? If they are in the same event line check that the assign values are below the creat object event using the event list editor.
It probably has something to do with the order of events, not only in the event editor itself, but even the order of the events (what are these called?) in the current event line. As already mentioned you should probably first create the object and assign values afterwards.
The problem seems to be that the right unit won't receive the right values. It seems that something is wrong with referencing the created object. And I haven't figured out how to get that to work yet.