SphereCommunity
Respawn conflict problem - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: Respawn conflict problem (/Thread-Respawn-conflict-problem)

Pages: 1 2 3


RE: Respawn conflict problem - Mordaunt - 02-19-2013 01:13 PM

Yeah I was too slow.
I understand if you are not wanting to put scripts up to solve problems for fear of them being stolen or copied.
If you want me to look at it, you can PM it to me, it will go no further.


RE: Respawn conflict problem - Staff_Stanic - 02-19-2013 01:21 PM

(02-19-2013 01:13 PM)Mordaunt Wrote:  Yeah I was too slow.
I understand if you are not wanting to put scripts up to solve problems for fear of them being stolen or copied.
If you want me to look at it, you can PM it to me, it will go no further.
exactly Confused
when you download, please let me know.


RE: Respawn conflict problem - Ben - 02-20-2013 10:14 AM

Ok I had a quick look at it and right away I noticed something not right.

ON=@Destroy
REF1=<UID>
FORCHARS 30
FOR x 1 <QVAL (<REF1.TAG0.PONTE2.Q> < <REF1.TAG0.QUANT>) ? <REF1.TAG.QUANT> : <REF1.TAG.PONTE2.Q>>
IF (<UID>==<REF1.TAG0.NPCL.<dLOCAL.X>>)
REMOVE <-------------------------------------NEVER DO INSIDE AN @DESTROY TRIGGER
ENDIF
ENDFOR
ENDFOR
FORCLIENTS 18
UPDATE
ENDFOR
REF2=<TAG.Boss_Respawn>
IF (<REF2>)
REF2.TAG.TOTAL --
ENDIF

I'm 99.99% sure that this is the probem.
You are removing the item just before it's removed... so when sphere deletes the item, it's accessing memory that is no longer allocated to this item.
Maybe it would be solved if you RETURN 1 so that it prevents the default destroy process.


RE: Respawn conflict problem - Staff_Stanic - 02-20-2013 10:53 AM

(02-20-2013 10:14 AM)Ben Wrote:  Ok I had a quick look at it and right away I noticed something not right.

ON=@Destroy
REF1=<UID>
FORCHARS 30
FOR x 1 <QVAL (<REF1.TAG0.PONTE2.Q> < <REF1.TAG0.QUANT>) ? <REF1.TAG.QUANT> : <REF1.TAG.PONTE2.Q>>
IF (<UID>==<REF1.TAG0.NPCL.<dLOCAL.X>>)
REMOVE <-------------------------------------NEVER DO INSIDE AN @DESTROY TRIGGER
ENDIF
ENDFOR
ENDFOR
FORCLIENTS 18
UPDATE
ENDFOR
REF2=<TAG.Boss_Respawn>
IF (<REF2>)
REF2.TAG.TOTAL --
ENDIF

I'm 99.99% sure that this is the probem.
You are removing the item just before it's removed... so when sphere deletes the item, it's accessing memory that is no longer allocated to this item.
Maybe it would be solved if you RETURN 1 so that it prevents the default destroy process.
This does not remove the item, removes the npc (forchars above)
Confused


RE: Respawn conflict problem - Mordaunt - 02-20-2013 11:11 AM

@Destroy fires WHEN an object is deleted from the world... not before it.
It is possible that with your 3 for loops running under this trigger that it is taking too long to execute, so whether the DESTROY is running on a character or an object that once it hits REMOVE the UID you are referring to is already gone thus causing a conflict.


RE: Respawn conflict problem - Staff_Stanic - 02-20-2013 11:17 AM

(02-20-2013 11:11 AM)Mordaunt Wrote:  @Destroy fires WHEN an object is deleted from the world... not before it.
It is possible that with your 3 for loops running under this trigger that it is taking too long to execute, so whether the DESTROY is running on a character or an object that once it hits REMOVE the UID you are referring to is already gone thus causing a conflict.
But when the system was in the shard, no one remove the item
Anyway i'll put "return 1" on the @destroy... tomorrow I give you an answer!
thank you guys!


RE: Respawn conflict problem - Staff_Stanic - 02-22-2013 06:25 AM

I disabled the trigger @Destroy but the problem continues :///


RE: Respawn conflict problem - RanXerox - 02-22-2013 06:48 AM

Most of us can't help you because you are not sharing your code...

If I were to guess, the problem is in your @timer function (or whatever it is that handles creatures being spawned)... If the newly spawned creature is not immediately put at the right location, then it might try to take an action (like walk to its home or look at stuff nearby) while it is still in limbo at coordinate 0,0,0,0 or something invalid like that.

When you create a creature using SERV.NEWNPC (or whatever), your very next command should be NEW.P


RE: Respawn conflict problem - Coruja - 02-22-2013 09:29 AM

the problem is: the default sphere internal spawn engine (worldgem bit) is being replaced with a custom scripted spawn system which does the same thing. It's causing conflicts between these 2 engines, including npc AI conflict, exception on map region blocks, exception on npc IDLE actions, etc

there was so many console exceptions (memory exception?) that sphere is acting dumb changing the server name (SERV.ServName) to Daemon, Corpser, Giant Spider or something like this, on npc creation it names the server not the npc roflmao

probably the best solution is use the default sphere spawn engine without touching it with custom engines to avoid these problems


RE: Respawn conflict problem - UltimaAku - 02-22-2013 09:51 AM

Second that for Coruja