Home   Help Search Login Register  

Author Topic: AI perform non-standard actions  (Read 717 times)

0 Members and 1 Guest are viewing this topic.

Bart

  • Guest
AI perform non-standard actions
« on: 28 Aug 2004, 19:13:19 »
what about the 'self-made actions'?
how can you let AI perform (press the action menu button) an action that isnt put standard in ofp?  

An example:
a scripter has made a hostage script, when you want to free the hostages you must press 'secure hostage' in the action menu
now, I want to know how an AI can perform this action...

I've been working on this issue for about 3 months now and I couldnt find an answer,

plz help me...  

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:AI perform non-standard actions
« Reply #1 on: 28 Aug 2004, 20:45:28 »
AI isn't AI.  It's programmed.    If you want a loon to do something, then it has to be programmed either by BIS (the built in stuff) or by you.    

There are lots of ways of doing this.   In your case you probably want a trigger that detects when the appropriate loon is in the right place:   a computer controlled loon activating a trigger is the equivalent of a human controlled loon clicking his action menu.
Plenty of reviewed ArmA missions for you to play

Bart

  • Guest
Re:AI perform non-standard actions
« Reply #2 on: 28 Aug 2004, 20:54:11 »
yes that i do know, but if i do it with the trigger the hostage script that has to be activated then wont work properly

the only solution to this issue is probably transform the script and hope it'll work?

cheers

rOk

  • Guest
Re:AI perform non-standard actions
« Reply #3 on: 28 Aug 2004, 21:59:16 »
How will it not work properly?

Bart

  • Guest
Re:AI perform non-standard actions
« Reply #4 on: 28 Aug 2004, 22:25:42 »
well there are four scripts for the hostages:

set_free
set_dead
set_captive
set_enemy

set_captive is the main script, it makes the hsotages hostage  ;)

set_dead is when they are dead, it makes them fall on the ground (rather than stand dead in hostage position hands in neck)

set_enemy is that enemies begin shooting at them

and set_free is to rescue them

now why it wont work is the scripts are all linked together
they use command lines like _this select 0
and if you dont let the Ai use the action menu command you will get errors

have a look at the scripts and then u will (probably) understand

SET_CAPTIVE:

_hostage = _this select 0

_hostage setCaptive true
_hostage switchMove "FXStandSurUniv"
_hostage setBehaviour "CARELESS"
_hostage addAction ["Secure Hostage", "hostages\set_free.sqs"]
_hostage addEventHandler ["killed", {_this exec "hostages\set_dead.sqs"}]
removeAllWeapons _hostage

exit

SET_DEAD:

_hostage = _this select 0

_hostage setCaptive false
_hostage switchmove ""
_hostage removeAction 0

exit

SET_ENEMY:

_hostage = _this select 0

_hostage setCaptive false
_hostage setBehaviour "COMBAT"
_hostage removeaction 0

exit

SET_FREE:

_player = player
_hostage = _this select 0

?!(alive _hostage):exit
?!(alive _player):exit

_hostage setCaptive false
_hostage switchMove ""
_hostage setBehaviour "COMBAT"
[_hostage] join _player
_hostage removeAction 0
"2" objStatus "Done"
obj2done = true

exit


well exept for all this bad news, I got good ones too  ;D

I've finished it, I have changed many things on the scripts and in the mission editor and I've finally (after 4.5h!!  :o) managed to get it to work :)

Thanks to MacGuba and a few of my scripting friends

Cheers guys

My map will soon be downloadable on a site (where I dont yet know  ;D)

Ofcourse I will post it to ofpec, opflashpoint, flashpoint1985, ... but for sure download look at this thread again in a few hours/days and u will find out where to go :)

(after 1.5 years of making my map perfect ;D ;D ;D)

Thanks to all the guys who helped making this map (that are about 100 peeps :D)

Bye

Bart

  • Guest
Re:AI perform non-standard actions
« Reply #5 on: 28 Aug 2004, 23:14:34 »
Ok since I cannot find any site that wants to contain my map  ::) I will say this:

get it on MSN (bartmaes5@hotmail.com) 2.5Mb

cheers!  8)