PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
(POL2006-01-18 Windows) createscript bug

 
Post new topic   Reply to topic    PenUltima Online Forum Index -> Bug Reports 096
Display posts from previous:   

Author Message
Core Essence



Joined: 07 Feb 2006
Posts: 15
Location: Palermo, Italy

PostPosted: Sun May 07, 2006 6:14 pm    Post subject: (POL2006-01-18 Windows) createscript bug Reply with quote

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

Author Message
Marilla



Joined: 02 Feb 2006
Posts: 329

PostPosted: Sun May 07, 2006 10:25 pm    Post subject: Reply with quote

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?

Author Message
Austin
POL Developer


Joined: 30 Jan 2006
Posts: 354
Location: San Diego, California

PostPosted: Sun May 07, 2006 10:36 pm    Post subject: Reply with quote

Correct - It isnt guarantee to exist yet. Also, try returning 1 at the end of your script.

Author Message
Core Essence



Joined: 07 Feb 2006
Posts: 15
Location: Palermo, Italy

PostPosted: Mon May 08, 2006 5:15 pm    Post subject: Reply with quote

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;

Post new topic   Reply to topic    PenUltima Online Forum Index -> Bug Reports 096 All times are GMT - 4 Hours
Page 1 of 1

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty