Welcome to the Builder Academy

Question Trigger help Disappearing eq

More
07 May 2013 23:55 #2171 by Nerian
Code:
set num 8300 while %actor.inventory% eval item %actor.inventory% eval item_to_purge %%actor.inventory(%item.vnum%)%% eval stolen %item.vnum% %send% %actor% Your %item.shortdesc% vanishes\! %purge% %item_to_purge% %at% %num% %load% obj %stolen% done eval i 0 while %i% < 18 eval item %%actor.eq(%i%)%% if %item% eval stolen %item.vnum% eval item_to_purge %%actor.eq(%i%)%% %send% %actor% Your %item.shortdesc% vanishes\! %purge% %item_to_purge% %at% %num% %load% obj %stolen% end eval i %i%+1 done


If the PC climbs into a hole all of their equipment gets teleported to a different room



but the trigger is throwing an error


[ Room 8318 :: wpurge: bad argument ]


anybody mind letting me know what I have done wrong so I can correct it?

Please Log in or Create an account to join the conversation.

More
08 May 2013 06:29 - 08 May 2013 06:33 #2175 by Fizban
Replied by Fizban on topic Trigger help Disappearing eq
You're not doing anything wrong, wpurge however seems to be somewhat broken, I encountered a similar issue earlier this week where mpurge worked just fine but wpurge failed to be able to purge items from a mobs inventory.

On an unrelated note though:
Code:
while %actor.inventory% eval item %actor.inventory% eval item_to_purge %%actor.inventory(%item.vnum%)%% eval stolen %item.vnum%

would be better written as:
Code:
while %actor.inventory% set item %actor.inventory% set item_to_purge %actor.inventory(%item.vnum%)% set stolen %item.vnum%

None of those lines require using eval, set will work just fine and use less cpu time. The %% are also un-needed. They are only required when double parsing.

Variables inside of variables only require double parsing when they aren't inside a subfield.

ie.

%%actor.inventory%random.3%%% < Tis requires double parsing

%actor.inventory(%random.3%)% < This does not

eval i %i%+1

that line there is in fact the only line that should use eval in the whole script.
Last edit: 08 May 2013 06:33 by Fizban.

Please Log in or Create an account to join the conversation.

More
09 May 2013 03:40 #2187 by Nerian
Replied by Nerian on topic Trigger help Disappearing eq
ah I thought those double % were not needed thanks for the confirmation


and you are absolutely right I didn't even realize I had put eval on those

Please Log in or Create an account to join the conversation.

Time to create page: 0.165 seconds