PenUltima Online

It is currently Sat Oct 11, 2008 5:27 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: reserved items
PostPosted: Thu Aug 03, 2006 4:57 am 
Offline

Joined: Mon Feb 06, 2006 6:12 am
Posts: 93
umm we have a problem were if an item is in use by a script and the player dies the item will get destroyed...

i know what the problem is im just not sure how to fix it... the item is reserved by one script and deleted by another... if we put releaseitem() in the second script it doesnt release it from the first... is there anyway around this... because using moveitemtocontainer() doesnt move reserved items :S

anyway around this?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 03, 2006 10:01 am 
Offline
User avatar

Joined: Sat Feb 04, 2006 8:17 am
Posts: 146
Location: Illinois, USA
I ran into this in my scripts at one time. The issue was mainly with bard and my provocation package. I just gave each bard a starting instrument and made it newbie.

If anyone has a better solution for this I would be interested also. :P

_________________
2nd place is the 1st loser.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 03, 2006 1:45 pm 
It would really depend on how your scripts work; Sounds to me like both the scripts in question need to be re-written to take various things into account. You would likely also have problems if the player logged off during the script(s) running.

You always need to be sure that scripts that reference a player check when necessary that the player is a) still alive and b) still online. Not only is this important in 'loops' like what seems to be going on here, but also it's important in any script that have a gump; Some people for instance assume that nodispose gumps will -never- return 'false' unless a button specifically has that value... but this can happen if a player logs off/loses connection.


Anyway... without knowing exactly what your script does, we couldn't fix it or tell you how to. Clearly, though, at some point your scripts need to be checking if the player has died or logged off, and take appropriate action. It's simple in principle and practice, but can't really be detailed for you without knowing your script.


Top
  
 
 Post subject:
PostPosted: Thu Aug 03, 2006 9:50 pm 
Offline

Joined: Sat Feb 04, 2006 5:49 pm
Posts: 772
Location: Chicago, IL USA
maybe...

See if you can get props from the item. If you can, set the PID as a prop to the item in the first script (would probably be wise to erase this prop too after the script exits). Then when the second script fails to move it and tries to delete it, try looking up and killing the PID from the second script (ultimately releasing it) and then try moving it.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 04, 2006 1:00 am 
Offline
POL Developer
User avatar

Joined: Sun Feb 12, 2006 9:50 pm
Posts: 836
Location: Indiana, USA
I remember this, with bandages, on IC. If you was healing, you lost the bandages, if was in a "newbied" zone for deaths.

In 095 (or was it 94?), using releaseitem on each item, in the chrdeath, seemed to fix it. Unsure if it still does with all the changes since.

_________________
POL Developer - The Penguin Scripter


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 05, 2006 7:53 pm 
Offline

Joined: Mon Feb 06, 2006 6:12 am
Posts: 93
thats exactly whats happening maud... its kinda a newbie zone sorta thing but alittle different... and the problem is ive released every item but they still dont seem to move :S


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl