BSL:AI activity: Difference between revisions

From OniGalore
Jump to navigation Jump to search
(trying to bring back BSL Group Table)
(using template for table header)
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
{| class="wikitable"
Commands for controlling the activity of AIs.
!Kind
{{TOCfloat}}
!Type
{| {{BSL Group Table Header}}<onlyinclude>{{BSL Group Table|{{PAGENAME}}}}</onlyinclude>
!Name
!Platform<onlyinclude>{{BSL Group Table|{{PAGENAME}}}}</onlyinclude>
|}
|}


Functions for controlling the activity of AIs.
==Active status==
{|
|-
|{{:ai2_active}}
|{{:ai2_inactive}}
|}
{|
|-
|{{:chr_all_active}}
|{{:chr_draw_all_characters}}
|{{:chr_disable_visactive}}
|}
{|
|-
|{{:chr_lock_active}}
|{{:chr_unlock_active}}
|}
Active characters are ones that can be collided with, attacked, etc. An active character can be passive or not passive (see next commands). It is normal for characters to become inactive when they have not been drawn (i.e., have not been on-screen) for a while. Thus, using '''chr_all_active''' or '''chr_draw_all_characters''' to force all characters to be evaluated as active is an unusual measure that is not to be taken lightly. Those two variables might in fact only have been useful for Oni's developers. Set '''chr_disable_visactive''' to true to avoid making characters active simply because they are being drawn. '''chr_lock_active''' obviously prevents a character from automatically going inactive, and '''chr_unlock_active''' removes the lock.
 
==Passive status==
{|
|-
|{{:ai2_allpassive}}
|{{:ai2_passive}}
|}
{|
|-
|{{:chr_freeze}}
|{{:chr_neutral}}
|}
 
Passive is not the opposite of active (see above). Even when passive, an AI can still be active. However, when these functions are passed "true" for "passive", the specified AI (or all AIs, with '''ai2_allpassive''') will stop all "intelligent" activity (melee, gunfights, pursuit), but passive AIs will still patrol. Since the default value for "passive" is 0, you don't need to pass anything for that argument to make an AI non-passive again; i.e., "ai2_allpassive();" turns off passiveness for all AIs. '''chr_freeze''' and '''chr_neutral''' are simply aliases for '''ai2_passive'''.


{{:ai2_active}}
==Alert status==
{{:ai2_setalert}}


[text about ai2_active]
Set AI's [[AI#Reactions and awareness|alert level]]. The argument "alert" can be "lull", "low", "medium", "high", "combat".


{{:ai2_idle}}
{{:chr_peace}}


[text about ai2_idle]
Turns off fighting animation pose (used in cutscenes).


[[Category:Scripting tasks]]
[[Category:Scripting tasks]]

Latest revision as of 03:43, 24 December 2015

Commands for controlling the activity of AIs.

Contents
Kind Type Name Platform
Italic f.png void ai2_active Platform-Win.png Platform-Mac.png
Italic f.png void ai2_allpassive Platform-Win.png Platform-Mac.png
Italic f.png void ai2_inactive Platform-Win.png Platform-Mac.png
Italic f.png void ai2_passive Platform-Win.png Platform-Mac.png
Italic f.png void ai2_setalert Platform-Win.png Platform-Mac.png
Italic v.png bool chr_all_active Platform-Win.png Platform-Mac.png
Italic v.png bool chr_disable_visactive Platform-Win.png Platform-Mac.png
Italic v.png bool chr_draw_all_characters Platform-Win.png Platform-Mac.png
Italic f.png void chr_freeze Platform-Win.png Platform-Mac.png
Italic f.png void chr_lock_active Platform-Win.png Platform-Mac.png
Italic f.png void chr_neutral Platform-Win.png Platform-Mac.png
Italic f.png void chr_peace Platform-Win.png Platform-Mac.png
Italic f.png void chr_unlock_active Platform-Win.png Platform-Mac.png

Active status

void
string or int
Edit this info
ai2_active(
ai_name or script_id
);
default: --
--
void
string or int
Edit this info
ai2_inactive(
ai_name or script_id
);
default: --
--

bool chr_all_active

bool chr_draw_all_characters

bool chr_disable_visactive

void
string or int
Edit this info
chr_lock_active(
ai_name or script_id
);
default: --
--
void
string or int
Edit this info
chr_unlock_active(
ai_name or script_id
);
default: --
--

Active characters are ones that can be collided with, attacked, etc. An active character can be passive or not passive (see next commands). It is normal for characters to become inactive when they have not been drawn (i.e., have not been on-screen) for a while. Thus, using chr_all_active or chr_draw_all_characters to force all characters to be evaluated as active is an unusual measure that is not to be taken lightly. Those two variables might in fact only have been useful for Oni's developers. Set chr_disable_visactive to true to avoid making characters active simply because they are being drawn. chr_lock_active obviously prevents a character from automatically going inactive, and chr_unlock_active removes the lock.

Passive status

void
bool
Edit this info
ai2_allpassive(
passive
);
default: --
false
void
string or int
bool
Edit this info
ai2_passive(
ai_name or script_id,
passive
);
default: --
--
false
void
string or int
bool
Edit this info
chr_freeze(
ai_name or script_id,
passive
);
default: --
--
false
void
string or int
bool
Edit this info
chr_neutral(
ai_name or script_id,
passive
);
default: --
--
false

Passive is not the opposite of active (see above). Even when passive, an AI can still be active. However, when these functions are passed "true" for "passive", the specified AI (or all AIs, with ai2_allpassive) will stop all "intelligent" activity (melee, gunfights, pursuit), but passive AIs will still patrol. Since the default value for "passive" is 0, you don't need to pass anything for that argument to make an AI non-passive again; i.e., "ai2_allpassive();" turns off passiveness for all AIs. chr_freeze and chr_neutral are simply aliases for ai2_passive.

Alert status

void
string or int
string
Edit this info
ai2_setalert(
ai_name or script_id,
alert
);
default: --
--
--

Set AI's alert level. The argument "alert" can be "lull", "low", "medium", "high", "combat".

void
string or int
Edit this info
chr_peace(
ai_name or script_id
);
default: --
--

Turns off fighting animation pose (used in cutscenes).