OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: David on 30 May 2006, 10:45:25
-
I'm trying to create a script that will spawn Ai in a given area, but failing.
Heres what i have so far.
I created a marker and called it Flag1Spawn, this is where I want the AI created, I then have the script called, ["Flag1Spawn"] exec "ai_respawn.sqs"
The contents of the ai_respawn.sqs as below
_FlagSpawn = _this Select 0
"SoldierWB" createUnit [getmarkerPos "_FlagSpawn",groupAlpha]
No AI is spawned in the area I want them to be, anyone got any ideas?
-
Hello David,
I assume here that _flagspawn is a marker name. In this case the
getMarkerPos "_flagspawn"
should be
getMarkerPos _flagspawn
since the marker name is already a string, implying that you have added a "" too much.
Also make sure that the "groupAlpha" variable points to a group on the map. I mean, it seems you have copied this value from the command reference, but this variable actually determines to what group the new unit is added. When a new unit is joined to the group of the player, for instance, "groupalpha"
could be replaced by "group player" (without the "" 's).
Hope this is of any help, Pim
-
Make sure that groupAlpha already exists before you try to create a unit into that group. You can do this by creating a unit of the same side and typing this in the init field:
groupAlpha = group this; deletevehicle this;
This will create the group, groupAlpha, but will also delete that unit so it is no longer on the map.
-Pilot