![]() |
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 |
imho instead of "myself.master.target_id" try "myself->GetCreatureFromIndex(myself.master.target_id)"
|
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 |
try to decompile it with sauron decompiler and check if the result is coherent.
|
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 :D |
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. |
Quote:
your code: Code:
i0=myself.master.target_index;change it maybe to "myself.InstantTeleport(c0, x_loc, y_loc, z_loc);" ? |
| All times are GMT. The time now is 16:06. |