SphereCommunity
My mounts wont REMOVE? - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: My mounts wont REMOVE? (/Thread-My-mounts-wont-REMOVE)



My mounts wont REMOVE? - Ultima One - 01-17-2013 06:43 AM

So, they all work, except when dismounting "argo.remove" does not seem to do anything. No errors. If I put a line above or below it saying "argo.color=07aa" it colors the steed fine... why wont it .remove?

Code:
[itemdef i_donator_horse]
name=Donator Horse Statuette
id=i_pet_horse
type=t_donator_statuette
tdata1=c_horse_tan
weight = 1
on=@create
attr=04

category=donator
subsection=donator pets
description=donator Horse Statuette


[function mount_donator]
if <cant_mount>
return 1
else
src.tag.ondonarmount = 1
serv.newnpc <args>
ref1=<new.uid>
serv.newitem i_memory
new.color=memory_ipet
new.link=<src.uid>
new.cont=<ref1.uid>
new.events -e_donator_mounts
ref1.food=999
ref1.color=<color>
ref1.tag0.donator_mount=<baseid>
ref1.tag0.donator_mount_color=<color>
ref1.tag0.donator_mount_owner=<tag.uid>
ref1.mount <src>
consume
endif


[events e_donator_mounts]    
on=@dismount
if <argo.tag0.donator_mount>
serv.newitem <argo.tag0.donator_mount>
new.cont=<src.uid>
new.color=<argo.tag0.donator_mount_color>
new.tag.uid=<argo.tag0.donator_mount_owner>
src.tag.lastdonarshrink = <new.uid>
src.tag.ondonarmount
argo.remove
src.events -e_donator_mounts
return 1
endif



RE: My mounts wont REMOVE? - darksun84 - 01-17-2013 09:21 AM

Do you have any custom @Destroy for your npc?


RE: My mounts wont REMOVE? - RanXerox - 01-17-2013 11:58 AM

This looks suspect: "new.events -e_donator_mounts" ...I don't think you can add an event to an item like this...


RE: My mounts wont REMOVE? - Mordaunt - 01-17-2013 12:04 PM

Actually looking at that line, even if you can add events that way, and I am not saying you can, you are actually removing the event by using the -


RE: My mounts wont REMOVE? - Ultima One - 01-17-2013 10:48 PM

The Event is on the player, not the new item, that -event on the new item must just be a mistake, never noticed it.

Still, the @Dismount event IS firing when dismounting. And running as desired.

Found out, it is FINE if I dismount, but it is only when I get Killed that the .REMOVE does not work. Everything else in the event runs fine and I get the steed statuette in my bag, but it does not remove the mount.

We do have another @Dismount event, which checks if you are hidden when you dismount, if so reveals you. But nothing that should effect the .remove (like I say, it runs the code as I can modify the steed both before and after it, just seems it wont remove it..)

Could someone see if they can remove a steed @dismount when dying while mounted?


RE: My mounts wont REMOVE? - darksun84 - 01-18-2013 12:01 AM

If you are dying argo.remove doesn't fire(bug?), but src.findlayer.25.remove will fire and remove the horse


RE: My mounts wont REMOVE? - Ultima One - 01-18-2013 12:50 AM

Thanks dark sun, I will try that when I get in Smile Server got busy very quickly and I need to get my donation items fixed Tongue


RE: My mounts wont REMOVE? - Ultima One - 01-18-2013 07:38 AM

Worked a wonder.

Thanks