OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Robinhansen on 26 Feb 2005, 11:37:09

Title: Replacement personel
Post by: Robinhansen on 26 Feb 2005, 11:37:09
I was thinking of why not expand the ammotrucks with replacement personel? When infantrycommanders etc. has lost 40% of his personal, he can regroup at the ammotruck. A little like the barrage in CTI, just whitout the mony stuff. I got the script to create soldiers, but not how to assign them to the players group.
Title: Re:Replacement personel
Post by: THobson on 26 Feb 2005, 11:58:20
Try:

[_pers] join player

EDIT:

In your script:  what is _eng?  It is a local variable that is not defined
Title: Re:Replacement personel
Post by: h- on 26 Feb 2005, 13:25:21
And you need to use createUnit instead of createVehicle...

createVehicled dudes do not join you...
Or anybody else for that matter...
Title: Re:Replacement personel
Post by: Dubieman on 26 Feb 2005, 21:45:50
Don't createvehicled people not respond at all? Or is that camcreate or both?
Cause I remember testing a throw script and I threw a west guy at someone except he was pretty much useless. Didn't move, blink, look around, fire, or die. :P
Title: Re:Replacement personel
Post by: macguba on 27 Feb 2005, 02:56:52
createVehicle is sort of like camCreate.    It just dumps an empty vehicle on the map.   It's not designed to do sexy stuff.
Title: Re:Replacement personel
Post by: General Barron on 27 Feb 2005, 03:58:08
You should use the createunit (http://www.ofpec.com/editors/comref.php?letter=C#createUnit) command when creating people, not createvehicle.
Title: Re:Replacement personel
Post by: Robinhansen on 27 Feb 2005, 14:40:13
I'm sorry! I choosed the wrong script in the first placed. The one below works and is the one I use:

_p = _this select 0
_d = getdir _p
_man = "SoldierEB" Camcreate [(getpos _p select 0)+(5*sin _d),(getpos _p select 1)+(5*cos _d),0]
_man setdir (_d - 180)

exit


I only need to know how to assign it to the player who request it

 ;)
Title: Re:Replacement personel
Post by: h- on 27 Feb 2005, 16:32:38
Don't createvehicled people not respond at all? Or is that camcreate or both?
Cause I remember testing a throw script and I threw a west guy at someone except he was pretty much useless. Didn't move, blink, look around, fire, or die. :P
CreateVehicled guys do bleed and such, but otherwise the are total vegetables :P

@Robinhansen:
That can not work. period.
camCreate creates an AI soldier alright but it has no 'life' in it...
It's just a shell...

So there is no way you can get a camCreated/createVehicled unit to join another, unless you rewrite OFP code somewheres...

Use createUnit, as suggested several times now ;)
Title: Re:Replacement personel
Post by: Robinhansen on 27 Feb 2005, 16:50:56
Right! now I finally got it  ::)
Is there a way to thange the "getMarkerPos" to, let's say a vehicle etc?
 :D