Core bug with pcequip.txt and equipscripts that create items

Here you can post threads specific to the current release of the core (099)
Post Reply
kevin
POL Developer
Posts: 53
Joined: Wed Sep 29, 2010 3:47 pm

Core bug with pcequip.txt and equipscripts that create items

Post by kevin »

Hi everybody...

We have an equippable item that has an OnEquipScript that creates a NEW item and also equips that (boots that create a mount and equips it on the character) . When the boots create-and-equip the brand new mount, the LAYER_MOUNT is now occupied for that character. Then, further down in the pcequip datafile, the old mount that the character had equipped during the world-save (serial 0x6adccefb) tries to get equipped [made some modifications to POL to find this issue]:
Item 0x6adccefb is supposed to be equipped on Character 0x22ed, but is not 'equippable' on that character.
Reason: !chr->equippable(item)
Current mount layer: serial 0x6adcd043
I'm so cool, I put it in the character's backpack!

The current, newly-created mount layer (serial 0x6adcd043) is the new item created with CreateItemX(). Now, pcequip.txt is loaded before other item-containing datafiles (items, storage, etc). The new serial created by the CreateItemX() function already exists in storage.txt, so when storage is loaded:
data/storage.txt:Duplicate item read from datafiles (Serial=0x6adcd043)
Then, the server exits. Thoughts? I'm guessing it's just not a good idea to create-and-equip items from an equipscript?

Edit: Using mount.saveonexit = 0 will fix the first issue of trying to equip the old and new mounts
Last edited by kevin on Thu Jan 06, 2011 6:02 pm, edited 1 time in total.
User avatar
*Edwards
Forum Regular
Posts: 303
Joined: Fri Dec 28, 2007 11:19 pm

Re: Core bug with pcequip.txt and equipscripts that create i

Post by *Edwards »

true, but you can let the server loads if you want. An entry in pol.cfg let you start POL even if duplicates objects are found.
kevin
POL Developer
Posts: 53
Joined: Wed Sep 29, 2010 3:47 pm

Re: Core bug with pcequip.txt and equipscripts that create i

Post by kevin »

Is there a way to defer the EquipScript until after the server completely loads? If you set IgnoreLoadErrors=1 in pol.cfg, it'll just use the first found serial number, it'll just vanish, and if the second item is something pretty good in the game that'll suck for the player.
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: Core bug with pcequip.txt and equipscripts that create i

Post by Austin »

The file scripts/misc/equiptest.src has the arguments

program EquipTest(mobile, item, start_up)

Start_up will be 1 if the server is starting, 0 any other time.
I can't remember if the rest of the equip scripts also have that parameter.. but try checking for it in them.
kevin
POL Developer
Posts: 53
Joined: Wed Sep 29, 2010 3:47 pm

Re: Core bug with pcequip.txt and equipscripts that create i

Post by kevin »

Ah, that's great! I'll just make it so the boots won't create the mount on startup, and players will just have to re-equip the boots on login for simplicity purposes.

Thanks!
User avatar
*Edwards
Forum Regular
Posts: 303
Joined: Fri Dec 28, 2007 11:19 pm

Re: Core bug with pcequip.txt and equipscripts that create i

Post by *Edwards »

I wonder if you'll find it usefull, but you could also simply change speed without equipping a mount.

Code: Select all

function PlayerSpeedBoost( player, toggle := 0 )

	if( toggle )
		SendPacket( player, "BF0006002601" ); //Speed like mounted
	else
		SendPacket( player, "BF0006002600" ); //Normal speed
	endif
 
        return 1;
endfunction
Post Reply