OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Yasirotta on 01 Sep 2008, 16:05:30

Title: "moveingunner" problem
Post by: Yasirotta on 01 Sep 2008, 16:05:30
I have soldier named as "Guard1". In his init line, i have code "This moveincargo jeep1".
Then i have trigger, and in activation line; Guard1 moveingunner jeep1

As usual, nothing works when i do something  :D
So, how i can move that guard1 from seat to gunner ?
Title: Re: "moveingunner" problem
Post by: Planck on 01 Sep 2008, 20:38:45
Something like:

Guard1 action ["moveToGunner", jeep1]


Planck
Title: Re: "moveingunner" problem
Post by: Gcfungus on 01 Sep 2008, 22:45:22
You could also use:
Code: [Select]
Guard1 moveingunner jeep1That would make him move instantly though. If that's a problem (like for a cutscene) then don't use it, but if it happens where players can't see, it would work more easily.
Title: Re: "moveingunner" problem
Post by: Mr.Peanut on 02 Sep 2008, 16:20:09
Just assign him as gunner assignAsGunner (http://www.ofpec.com/COMREF/#28). For the realistic effect, unassign him from the vehicle and eject him. Wait a second and then assign him as gunner. He will get in himself, unless his stewpid ai pathfinding leaves him stuck on the corner of the bumper.
Title: Re: "moveingunner" problem
Post by: Yasirotta on 06 Sep 2008, 15:43:06
New problem.

Now gunner works great, and it looks to right direction. However, when friendly guys start firing in another place, this gunner will point them whit his PK. Feels like gunner dont regonize are those friendly on not ? Skill level doesnt help this.

And how to get gunner stay in that vechile ? When vechile take a little damage, gunner will get out from jeep.
Title: Re: "moveingunner" problem
Post by: Mr.Peanut on 07 Sep 2008, 18:09:16
If he didn't think they were friendly, he would shoot them!
Is this gunner a member of a player group?

As for gunners getting out of a damaged jeep, there is no fix. That is default AI behaviour. If you really need him to stay in the jeep, then you will have to add an eventhandler to the jeep that keeps it from getting damaged or reduces the damage. Put it in the script were you maker the gunner get in the jeep.

Code: [Select]
myJeep addEventHandler["hit",{(_this select 0) setDamage 0}]or
Code: [Select]
myJeep addEventHandler["hit",{(_this select 0) setDamage (damage _this select 0)*0.5}]
When you want to turn it off:
Code: [Select]
myJeep removeAllEventHandlers "hit"