Page 1 of 1

Core bug with pcequip.txt and equipscripts that create items

Posted: Thu Jan 06, 2011 5:40 pm
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

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

Posted: Thu Jan 06, 2011 5:58 pm
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.

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

Posted: Thu Jan 06, 2011 6:05 pm
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.

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

Posted: Thu Jan 06, 2011 11:09 pm
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.

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

Posted: Thu Jan 06, 2011 11:37 pm
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!

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

Posted: Fri Jan 07, 2011 4:20 pm
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