Post Pacific  

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

Notices

 
 
Thread Tools Search this Thread Display Modes
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  
Old 16.06.2007, 15:31   #2
FidoW
Архивный участник
 
Join Date: Sep 2005
Posts: 1,014
Default

handler 5 25 // SEE_CREATURE

Thats wrong.
FidoW is offline  
Old 16.06.2007, 16:02   #3
Bloodust
Архивный участник
 
Join Date: May 2006
Posts: 135
Default

I was looking at ai.obj and there seems to be like 10 different SEE_CREATURE handlers, whats the difference between them ?
Bloodust is offline  
Old 16.06.2007, 16:15   #4
ateh
Архивный участник
 
Join Date: Apr 2006
Posts: 118
Default

lol? There is just one SEE_CREATURE handler....
ateh is offline  
Old 16.06.2007, 16:19   #5
Sdw
Архивный участник
 
Join Date: Sep 2005
Posts: 150
Default

Handler 5 is right. So I guess the second number is false.
What is it ? Number seems to change, according to ... ? I'll try to guess.
Sdw is offline  
Old 16.06.2007, 16:32   #6
Bloodust
Архивный участник
 
Join Date: May 2006
Posts: 135
Default

Quote:
Originally Posted by ateh View Post
lol? There is just one SEE_CREATURE handler....
Only one my ass lol

handler 5 391 // SEE_CREATURE
handler 5 231 // SEE_CREATURE
handler 5 917 // SEE_CREATURE
handler 5 481 // SEE_CREATURE
handler 5 426 // SEE_CREATURE

5 seems to remain but what are the other numbers then, I cant see the pattern ...
Bloodust is offline  
Old 16.06.2007, 16:34   #7
m4rk
Архивный участник
 
Join Date: Jan 2006
Posts: 607
Default

number of lines: 54

handler 5 54 // SEE_CREATURE
m4rk is offline  
Old 16.06.2007, 16:36   #8
Sdw
Архивный участник
 
Join Date: Sep 2005
Posts: 150
Default

C4 sucks ... Thanks. T_T.
Sdw is offline  
Old 16.06.2007, 16:39   #9
Bloodust
Архивный участник
 
Join Date: May 2006
Posts: 135
Default

aah, Thanks m4rk, you are truly an information library of L2 server files :P
#include <m4rk.h> O.o
Bloodust 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 17:07.