Welcome to the Builder Academy

Question Stumped - Object Load/Purge Triggers

  • Silvaria
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Writer, Builder, Artist, Newbie!Programmer
More
02 May 2013 23:49 - 02 May 2013 23:50 #2072 by Silvaria
I couldn't help but leap into triggering before all my mobs were created.

Unfortunately, I may have leapt in before I was ready...

Here is what I'm *trying* to achieve:

Code:
Name: Daytime Mushrooms Wilt - obj 59398 Intended for : Rooms Trigger types: Global Random Numeric Arg : 100 Commands: * This trigger is intended to purge Obj 59398 from the room, if it exists when the trigger fires. wait until 7:00 wait 5 seconds if ((Obj 59398 exists in this room)) %echo% The small mushrooms wither to hide beneath the underbrush until night falls again. %purge% obj 59398 end

I'm having trouble figuring out what to replace the statement within double parentheses with to have the trigger return a true value and activate the other two commands. Do I need to change this to an object trigger to have it work correctly?

Trigger 59300 and 59301 are the coinciding triggers for the effect I'm trying to create, if anyone is free to take a peek at them.

Began building in July, 2012.

Began learning C in July, 2013.

Downloaded ROM and TBAmud in August, 2013.

Conversion nearly complete.
Last edit: 02 May 2013 23:50 by Silvaria.

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

More
03 May 2013 05:44 #2076 by Fizban
Code:
Name: Daytime Mushrooms Wilt - obj 59398 Intended for : Rooms Trigger types: Global Random Numeric Arg : 100 Commands: * This trigger is intended to purge Obj 59398 from the room, if it exists when the trigger fires. wait until 7:00 wait 5 seconds eval checkobj %%findobj.%self.vnum%(59398)%% if %checkobj% > 0 %echo% The small mushrooms wither to hide beneath the underbrush until night falls again. set item %self.contents% while %item% set next %contents.next_in_list% if %item.vnum(59398)% %purge% %item% end set item %next% done end

That should work, but is untested, if it doesn't let me know and I'll fix it.
The following user(s) said Thank You: Silvaria

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

  • Silvaria
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Writer, Builder, Artist, Newbie!Programmer
More
03 May 2013 15:15 - 03 May 2013 15:17 #2085 by Silvaria
[strike]After a quick test, it returned: [ findobj.vnum(ovnum) - illegal syntax ]

If you saw the error pop up in the MUD, I remedied the missing "end" lol. That was my mistake, for not having scrolled all the way down when transposing it.[/strike]

Scratch that!!!! Omg, I'm a proofreader for a living practically, and I didn't proof my own typing.
Code:
%findobj.%self.vnum%959398)%

*headdesk*

Began building in July, 2012.

Began learning C in July, 2013.

Downloaded ROM and TBAmud in August, 2013.

Conversion nearly complete.
Last edit: 03 May 2013 15:17 by Silvaria.

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

  • Silvaria
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Writer, Builder, Artist, Newbie!Programmer
More
03 May 2013 15:37 #2086 by Silvaria
Hmm. This time it returned the following:

Code:
Trigger: Daytime Mushrooms Wilt - obj 59398, VNum 59301, type: 2. unknown room field: 'vnum'

Began building in July, 2012.

Began learning C in July, 2013.

Downloaded ROM and TBAmud in August, 2013.

Conversion nearly complete.

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

More
03 May 2013 15:51 - 05 May 2013 02:46 #2087 by Fizban
Actually it looks like you typoed something, I just saw the error, it actually reads:

[ Trigger: Daytime Mushrooms Wilt - obj 59398, VNum 59301, type: 2. unknown room field: 'vum' ]

'vum' not 'vnum', it's because you have: eval checkobj %%findobj.%self.vum%(59398)%%
Last edit: 05 May 2013 02:46 by Fizban.

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

  • Silvaria
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Writer, Builder, Artist, Newbie!Programmer
More
03 May 2013 15:54 #2088 by Silvaria
LSKDJFL. Omg. lol. should've caught that agghh.

Began building in July, 2012.

Began learning C in July, 2013.

Downloaded ROM and TBAmud in August, 2013.

Conversion nearly complete.

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

Time to create page: 0.200 seconds