Home   Help Search Login Register  

Author Topic: trigger to createvehicle and more  (Read 2530 times)

0 Members and 1 Guest are viewing this topic.

Offline KevBaz

  • Members
  • *
trigger to createvehicle and more
« on: 18 Jul 2009, 01:36:03 »
hi folks, im trying to create a trigger that detects the altitue of a player and if over a certain height it spawns a sam site, mans it, targets the player and fires at the player.

so far i have this in a trigger but no joy

 

cond

Code: [Select]
(getPos ap select 2) > 100

act

Code: [Select]
sam = createVehicle ["stinger_pod", getpos player]; "RUS_Soldier2" createUnit [position sam, group red,"this moveingunner sam; sam dotarget ap; sam dofire ap"];

any ideas?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: trigger to createvehicle and more
« Reply #1 on: 18 Jul 2009, 12:26:57 »
Try:

sam = "stinger_pod" createVehicle getpos player; "RUS_Soldier2" createUnit [(getpos sam), groupred,"this moveingunner sam; sam dotarget ap; sam dofire ap"];

One thing though, the groupName must exist or the crew unit won't be created.


Planck
« Last Edit: 18 Jul 2009, 12:38:36 by Planck »
I know a little about a lot, and a lot about a little.

Offline KevBaz

  • Members
  • *
Re: trigger to createvehicle and more
« Reply #2 on: 18 Jul 2009, 14:00:09 »
thanks for the reply, but its still not working

i have a unit on the map with this in his init

red = group this

thats enough to create the group isnt it?

should the trigger be sync'd with the player? or is there a better way to do it?

i dont get any errors just nothing gets created


over at bis ive had some help from F2k Sel

http://forums.bistudio.com/showthread.php?t=80453

Code: [Select]
// nul=[target] execVM"spawn.sqs"

_target = _this select 0;

_unit = "RUS_Soldier2";
mygroup = creategroup side player;
_sam = createVehicle ["stinger_pod", getpos player,[],0,"fly"];
_unit createUnit [(getpos player), mygroup,"man=this;"];
_unit = man;
_unit moveingunner _sam;
_sam reveal _target;
_sam dotarget _target;
_sam dofire _target;

Code: [Select]
nul=[ap] execVM"spawn.sqs"
this now spawns the stinger (YAY!) , but its in midair, is there a way to make it spawn on the players location but on the ground within a set diameter?
« Last Edit: 18 Jul 2009, 14:12:29 by KevBaz »