Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 16.06.2007, 14:38   #1
Sdw
Архивный участник
 
Join Date: Sep 2005
Posts: 150
Default An AI question / problem.

I'm trying to make a holy ****ing easy AI and I can't get it to work.

Here is what I'm trying to do :
Code:
class 1 giran_guard_clan : guard_stand
{
	handler SEE_CREATURE (creature, myself)
	{
		if((myself->GetLifeTime() > 5 && myself->InMyTerritory(myself.sm) == 1 && creature->pledge_id == 2))
		{
			myself->AddAttackDesire(creature, 1, 1500);
		}
	}
}
Compiled version :
Code:
class 1 giran_guard_clan : guard_stand

handler 5 25	// SEE_CREATURE
		variable_begin
			"creature"
			"myself"
			"_choiceN"
			"_code"
			"_from_choice"
		variable_end
		
		push_event	// myself
		push_const 704
		add
		fetch_i
		func_call 184549406	// func[GetLifeTime]
		push_const 5
		greater
		push_reg_sp
		fetch_i
		branch_false L300001
		push_event	// myself
		push_const 704
		add
		fetch_i
		push_event	// myself
		push_const 704
		add
		fetch_i	// sm
		push_const 544
		add
		fetch_i
		func_call 184615156	// func[InMyTerritory]
		shift_sp -1
		push_const 1
		equal
		and
		push_event	// creature
		push_const 112
		add
		fetch_i	// pledge_id
		push_const 792
		add
		fetch_i4
		push_const 2 // clan 2
		equal
		and
		branch_false L300001	
L300000
		push_event	// myself
		push_const 704
		add
		fetch_i
		push_event	// creature
		push_const 112
		add
		fetch_i
		push_const 1
		push_const 1500
		func_call 184745993	// func[AddAttackDesire]
		shift_sp -3
		shift_sp -1
L300001
handler_end
		
class_end
Resulting error :
Quote:
[+] Incomplete code information
[+] PC=[ 25], ai=[giran_guard_clan],handler=[SEE_CREATURE]
The C1 version I've kept works fine but I can't get it to work in C4, don't know why. It's bothering me since it's so easy & it doesn't work.

Thanks for your help.
Sdw is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 15:52.