PenUltima Online

It is currently Sat Aug 30, 2008 3:19 am

All times are UTC - 8 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: (POL2006-01-18 Windows) createscript bug
PostPosted: Sun May 07, 2006 2:14 pm 
Offline
User avatar

Joined: Tue Feb 07, 2006 10:40 am
Posts: 16
Location: Palermo, Italy
If I set a createscript on an item and I want to utilize the method .container of the item, it returns error even if the item is in a container (utilizing CreateItemInBackpack())

Code:
use uo;

program create_darkpalabook(item)
  var newspellbook;
  if(!item.container)
    newspellbook:=CreateItemAtLocation(item.x, item.y, item.z, 0x2252, 1, item.realm);
  else
    newspellbook:=CreateItemInContainer(item.container, 0x2252, 1);
  endif
  SetName(newspellbook, item.desc);
  newspellbook.color:=item.color;
  SetObjProperty(newspellbook, "Obs", 1);
  return 0;
endprogram


It always do the CreateItemAtlocation and if the fake item is in a container item.x/y/z are == 0

_________________
Image
VenuS Scripter [Hosted by M4D]


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 07, 2006 6:25 pm 
I was under the impression that you shouldn't try to refer to an item's location in it's create script, as it might not actually BE there, yet. Did something here change from 095 to 096?


Top
  
 
 Post subject:
PostPosted: Sun May 07, 2006 6:36 pm 
Offline
POL Developer
User avatar

Joined: Wed Jan 25, 2006 2:30 am
Posts: 400
Location: San Diego, California
Correct - It isnt guarantee to exist yet. Also, try returning 1 at the end of your script.

_________________
-Austin


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 08, 2006 1:15 pm 
Offline
User avatar

Joined: Tue Feb 07, 2006 10:40 am
Posts: 16
Location: Palermo, Italy
With return 1; it's the same thing. However, i think it's better that createscript is activated after complete object creation (before loading control script) and then destroyed with return 0;

_________________
Image
VenuS Scripter [Hosted by M4D]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl