Home   Help Search Login Register  

Author Topic: Injured AI in vehicles  (Read 927 times)

0 Members and 1 Guest are viewing this topic.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Injured AI in vehicles
« on: 10 Nov 2004, 08:14:56 »
I am beginning to think my ambition for my current mission is beginning to outreach my ability.  I keep bumping into some very simple problems.

I now have a problem that appears to be caused by AI in a jeep getting injured (maybe they bumped into a tree or something).  The jeep then heads for a nearby field hospital and just waits there.  The injured guy does not get out and he does not get healed so the jeep is stuck for the rest pf the mission.  I can write a script that deal with this, but do I need to?  Am I missing something?

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Injured AI in vehicles
« Reply #1 on: 10 Nov 2004, 10:58:49 »
have a trigger where he is supposed to drive but gets hurt, that covers as much of the road he will use as you can. Group it to him, and use Vehicle Present to activate
on activation:
UnitName addeventhandler ["hit", {this exec "SetDammage.sqs"}];UnitName addeventhandler ["dammaged", {UnitName setdammage 0}]
    (of course you could also have a looping script to provide his current health and set it to that for the dammaged script, which would  probably make this work, if it doesn't already)
and on deactivation:
UnitName removeeventhandler ["hit",0]; Unitname removeeventhandler ["dammaged",0 or 1 (not sure..)]
or:
UnitName RemoveAllEventHandlers but that will only work if he doesn't have any others yet

Setdammage.sqs
Code: [Select]
_dammage = getdammage unitname
~1
unitname setdammage _dammage
exit

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Injured AI in vehicles
« Reply #2 on: 10 Nov 2004, 13:59:22 »
Thanks. That is interesting. I never thought of using a "hit" event.  I will look at that.

I presume I am correct though - the AI is smart enough to go to the field hospital when it is injured, but not smart enough to get out of the jeep, and the field hospital cannot heal AI units in vehicles.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Injured AI in vehicles
« Reply #3 on: 10 Nov 2004, 14:47:56 »
I believe you are correct.

Quote
I am beginning to think my ambition for my current mission is beginning to outreach my ability.  I keep bumping into some very simple problems.

Yup.    Desiging missions is probably piss easy once you know how to do it.   Trouble is, nobody does, not really.   You always spend most of the time figuring out how to do things that should be really easy, but aren't.
Plenty of reviewed ArmA missions for you to play

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Injured AI in vehicles
« Reply #4 on: 10 Nov 2004, 15:16:17 »
I am beginning to think my ambition for my current mission is beginning to outreach my ability.  I keep bumping into some very simple problems.

 ::)

Why you all looking at me? ;D

Just you see. I think I'll do it before OFP 2. Almost. ;D

:beat: *Gets Shot* :beat: