Post Pacific  

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

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 19.12.2006, 18:58   #1
alysia
Архивный участник
 
Join Date: Apr 2005
Posts: 151
Default just a AI-code question

this is just something for fun but it doesn't work...

it should be on a summon (with a skill button) that recalls the target (npc or player) to the summon position (like porta in cruma tower)

but the problem is that the part here doesn't work I always get a server error

NPCINSTANTTELEPORT cannot find NPC



here the part for the teleport


push_event // myself
push_const 704
add
fetch_i
push_event // myself
push_const 704
add
fetch_i // master
push_const 552
add
fetch_i // target_id
push_const 444
add
fetch_i4
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 // x
push_const 8
add
fetch_d
func_call 184615005 // func[FloatToInt]
shift_sp -1
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 // y
push_const 16
add
fetch_d
func_call 184615005 // func[FloatToInt]
shift_sp -1
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 // z
push_const 24
add
fetch_d
func_call 184615005 // func[FloatToInt]
shift_sp -1
func_call 184811596 // func[InstantTeleport]
shift_sp -4
shift_sp -1




thx for help
alysia is offline  
Old 19.12.2006, 21:01   #2
hr
Архивный участник
 
Join Date: Jun 2005
Posts: 285
Default

imho instead of "myself.master.target_id" try "myself->GetCreatureFromIndex(myself.master.target_id)"
hr is offline  
Old 02.01.2007, 16:42   #3
alysia
Архивный участник
 
Join Date: Apr 2005
Posts: 151
Default

happy new year

ok i tried a diffrent method but still the same error



here the code


push_event // i0
push_const 260
add
push_reg_sp
fetch_i
push_event // myself
push_const 704
add
fetch_i // master
push_const 552
add
fetch_i // target_index
push_const 440
add
fetch_i4
assign4
shift_sp -1
push_event // i0
push_const 260
add
fetch_i4
push_const 0
less_equal
branch_false L122101
L122100
exit_handler
L122101
push_event // c0
push_const 344
add
push_reg_sp
fetch_i
push_event // myself
push_const 704
add
fetch_i
push_event // i0
push_const 260
add
fetch_i4
func_call 184614954 // func[GetCreatureFromIndex]
shift_sp -1
assign
shift_sp -1
push_event // c0
push_const 344
add
fetch_i
branch_false L122103
L122102
L122105
push_event // myself
push_const 704
add
fetch_i
push_event // myself
push_const 704
add
fetch_i // master
push_const 552
add
fetch_i // target_id
push_const 444
add
fetch_i4
push_parameter x_loc
push_parameter y_loc
push_parameter z_loc
func_call 184811596 // func[InstantTeleport]
shift_sp -7
shift_sp -1



but still a server-error: NpcInstantTeleport cannot find npc
alysia is offline  
Old 02.01.2007, 16:51   #4
m4rk
Архивный участник
 
Join Date: Jan 2006
Posts: 607
Default

try to decompile it with sauron decompiler and check if the result is coherent.
m4rk is offline  
Old 02.01.2007, 18:56   #5
alysia
Архивный участник
 
Join Date: Apr 2005
Posts: 151
Default

hmm.... i get only this


class recall : (null)
{
parameter:
int DDMagic = 311297;
int PhysicalSpecial = 311297;
int SkillCastingTime = 2000;
int x_loc = 113658;
int y_loc = 15289;
int z_loc = 10080;

handler:
EventHandler CREATED()
{
i0 = myself.master.target_index;
if( i0 <= 0 )
{



no more
alysia is offline  
Old 02.01.2007, 20:06   #6
m4rk
Архивный участник
 
Join Date: Jan 2006
Posts: 607
Default

I think the code you give must be in
MENU_SELECTED handler and not in CREATED

anyway there seems to be an error in your code, i'll read through it better later.
m4rk is offline  
Old 03.01.2007, 09:32   #7
humordwarf
Архивный участник
 
Join Date: Feb 2006
Posts: 453
Default

Quote:
Originally Posted by alysia View Post
hmm.... i get only this


class recall : (null)
{
parameter:
int DDMagic = 311297;
int PhysicalSpecial = 311297;
int SkillCastingTime = 2000;
int x_loc = 113658;
int y_loc = 15289;
int z_loc = 10080;

handler:
EventHandler CREATED()
{
i0 = myself.master.target_index;
if( i0 <= 0 )
{



no more

your code:
Code:
i0=myself.master.target_index;
if (i0 <= 0) {
	return;
}
c0=myself.GetCreatureFromIndex(i0);
if (c0) {
  myself.InstantTeleport(myself.master.target_id, x_loc, y_loc, z_loc);
}
declaration: void InstantTeleport(CSharedCreatureData, int, int, int);
change it maybe to "myself.InstantTeleport(c0, x_loc, y_loc, z_loc);" ?
humordwarf 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:42.