DeleteVehicle Problem in FSM

Silver85

Member
Hello everyone, i have a little problem with despawning a unit.
I want to run the Namals bloodsuckers on my Epoch Server. I am able to spawn the units with this:

_unitbs = "ns_bloodsucker" createUnit [_Pos, group sefik,"",1,"PRIVATE"];

The AI is working great (targeting, following etc)
but i can not delete them with

deletevehicle _unitbs

i always get the error:

Error in expression <deletevehicle _unitbs;
true;>
Error position: <_unitbs;
true;>
Error Undefined variable in expression: _unitbs


when i use the creat unit arrey methode like this:

_unitbs = group sefik createUnit ["ns_bloodsucker", _Pos, [], 0, "CAN COLLIDE"];

then i am able to delete the unit with the deletevehicle _unitbs - The problem here: The AI is doing nothing???
Any ideas how to get both to work?

Thank you
 
any variable with an underscore such as _unitbs, is LOCAL, meaning that once you exit the script that creates the unit, that variable no longer exists .. hence the error "undefined variable".
not sure why the second method would work.
are you deleting them from within the same file that creates them?
if not you will have to pass the _unitbs variable to the deletion script.

post your relevent files if you want
 
see, your new unit variable has no underscore so its not local to the file its creates in.

will look at the file at home this evening.
 
Back
Top