PDA

View Full Version : need help with ai


divine
05.03.2006, 10:47
shift_sp 1
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i
func_call 177 // func[InMyTerritory]
shift_sp -1
and
L1892
branch_false L1894
L1893
shift_sp 1
push_event // creature
push_const 68
add
fetch_i
push_const 1
push_const 200
func_call 2 // func[AddAttackDesire]
shift_sp -3
shift_sp -1
L1894

can someone explain me what does push_const do in this cases

Xellos
05.03.2006, 10:57
here the decompiled code:
if (<expression_from_stack> && InMyTerritory(myself.sm)) {
AddAttackDesire(creature, @AMT_MOVE_TO_TARGET, 200);
}

it's referring to a sub structure of the npc

divine
05.03.2006, 11:08
ic, but the question was what does this mean 1 and 200

cose i want to replace this part with AddUseSkillDesire

Xellos
05.03.2006, 11:28
AMT_STAND = 0 // fixed, does not move
AMT_MOVE_TO_TARGET = 1 // no words ;)

AddAttackDesire(target, @AMT, priority?)

i call the 3rd parameter priority, because u can use it to let the npc switch targets/states (but it's the initial set and the npc seems to recalculate it)

kvoxi
05.03.2006, 12:36
ic, but the question was what does this mean 1 and 200

cose i want to replace this part with AddUseSkillDesire
1 - AMT (see Xellos explanation)
200 - DesireValue (see https://postpacific.loc-online.com/forum/viewtopic.php?t=3666)

Xellos
05.03.2006, 12:58
ah, there is the post that i was looking for ^^
but that is exactly was i mean
(describing is not so my thing...)