SphereCommunity
ON=@Destroy for Chars Buggy? - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: ON=@Destroy for Chars Buggy? (/Thread-ON-Destroy-for-Chars-Buggy)



ON=@Destroy for Chars Buggy? - admin phoenix - 08-24-2012 05:08 PM

Hi Folks,

haven´t the script here yet but the code is very simpel. I use it for my summon npcs and there are two problem. When I set the uid to the ref1 object it works but the trigger fires twice and in the second round I don´t have a uid so the console set me an error that it can´t find the ref1.tag0.summon.
I put this code to my e_allnpc event so that every npc got this event.


Code:
ON=@Destroy
IF (<flags>&statf_conjured)
      ref1=<findlayer(41).link>
      ref1.tag0.summon -=1
      ref1.smsg You summon creature has gone.
ENDIF

The fix around is

Code:
ON=@Destroy
IF (<flags>&statf_conjured)
  IF (<dvar0.summon_bug> == 1)
      local.uid=<findlayer(41).link>
      ref1=<local.uid>
      ref1.tag0.summon -=1
      ref1.smsg You summon creature has gone.
      var0.summon_bug=
   ELSE
      var0.summon_bug=1
ENDIF
ENDIF

Anyone can confirm this one?

gr

Phoenix

[Edit] I fixed it with another workaround with removing the memory item from the npc. This works now but it is also a bug.


RE: ON=@Destroy for Chars Buggy? - Shaklaban - 08-24-2012 05:33 PM

hmm i don't understand first one, if you mean ref1 is not assigned you can use ref1=<owner>.


RE: ON=@Destroy for Chars Buggy? - Extreme - 08-24-2012 10:07 PM

Yeah its bugged.
When I was scripting the Energy Vortex spell, when it disappear, it removes doubled followers.
Destroy is firing 2 times, very nice =D
I used a tag too to fix it.


RE: ON=@Destroy for Chars Buggy? - RanXerox - 08-25-2012 05:27 AM

Out of curiosity, log ARGN1 ARGN2 and ARGN3 and see if they somehow distinguish between the first and second execution of the trigger...


RE: ON=@Destroy for Chars Buggy? - admin phoenix - 09-07-2012 12:03 AM

because Ben can´t produce this error and closed my bug report in the tracker, I push this thread up.


RE: ON=@Destroy for Chars Buggy? - darksun84 - 09-07-2012 03:53 AM

After some test, i noticed that it's not a problem of the @Destroy trigger

If we change the TYPE (t_spell) of the item inside layer 41 to another type, the trigger it's fired only one time!

So the bug it's related to summoning creature by magic spells i think.

Adding the trigger to a npc summoned by addnpc, and applying the flag conjured, the trigger it' till fired one timen(because it doesn't have the item on layer 41).

Other thing, if we remove the item on layer 41, the summoned (by magic) creature disappear, but the trigger it's fired only one time !

Same thing if we delete the creature with command .remove

The bug appear then when the creature is killed by .kill or by damage


RE: ON=@Destroy for Chars Buggy? - Ben - 09-11-2012 01:07 PM

is this atleast with the latest build?


RE: ON=@Destroy for Chars Buggy? - darksun84 - 09-12-2012 11:35 AM

yes!

WL_test.scp,26)Air Elemental 1516,1630,-13 01fc8
03:34:(WL_test,27)0
03:34:(WL_test.scp,26)Air Elemental 1516,1630,-13 01fc8
03:34:(WL_test.scp,27)0


RE: ON=@Destroy for Chars Buggy? - Ben - 09-16-2012 12:29 AM

Problem found, problem confirmed! Error occures when the char is destroyed before the spell is over... the memory object is then destroyed and calls to destroy the char again as if it got dispelled Smile Not sure yet how to prevent it, but I'm working on it!


RE: ON=@Destroy for Chars Buggy? - Ben - 09-17-2012 02:06 AM

Should be fixed in build 1534