Welcome to the Builder Academy

Question I've got another one..

  • Silvaria
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Writer, Builder, Artist, Newbie!Programmer
More
05 Apr 2013 12:10 - 05 Apr 2013 12:11 #1792 by Silvaria
I could have sworn I saw this somewhere...

Here's the jist of what I was hoping to set up. I have a notake container that I want to spawn 1 rose every 5 min or so if someone has taken the rose out of the container.

container = 59319
rose = 59320

so. something like this...

if 59319 is empty
load 59320

elseif 59319 has_item(59320)
do nothing
wait 5 min

but I have no idea how to make the trigger do what I want. I've been trying to figure it out...

Do I start with a check command? Should I make the trigger vnum the same as the room its in or as the object vnum I want it to load (59320), so that %self% is the rose? Should %self% be the bush instead?? Arrg lol.

Began building in July, 2012.

Began learning C in July, 2013.

Downloaded ROM and TBAmud in August, 2013.

Conversion nearly complete.
Last edit: 05 Apr 2013 12:11 by Silvaria. Reason: forgot a detail

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

More
05 Apr 2013 14:32 #1795 by Rumble
Replied by Rumble on topic I've got another one..
This one is a bit tough. I'll help you on TBA tonight. An object trigger that checks self.contents for that vnum is probably the way to go. Checkload may not work for inside containers, I forget. Check the helpfiles for both and search triggers with "vnum trig content" "vnum trig checkload" for examples.

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com

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
05 Apr 2013 14:47 #1796 by Silvaria
Replied by Silvaria on topic I've got another one..
Gotcha! All right, I will do some research before I see you tonight.

Thanks Rumble!!

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
05 Apr 2013 15:12 - 05 Apr 2013 15:29 #1798 by Fizban
Replied by Fizban on topic I've got another one..
The following was written in this post, not in trigedit, and as such is completely untested, but should work, or at the very least work with very minor changes.
Code:
Type: Random Numeric Arg: 100 wait 300 s if !%self.contents% %load% mob <insert mob vnum> else set curr_item %self.contents% while %curr_item% if %curr_item.vnum% == 59320 halt else set %curr_item% %curr_item.next_in_list% end done %load% mob <insert mob vnum> end

This would then combine with a load script on a mob (the one I referenced twice but gave no specific vnum), which loads the rose, puts it into the container, and then purges itself when loaded since unless it was added fairly recently I don't recall there being any means to directly load an object inside of another object with trigedit.

One potential downside of this route is that when the mob puts the rose into the container any players present at the time will see the mob do so.

If you'd prefer the script could be edited so that the rose is only added to the container if the room has no players currently in it though.

The following is the same script, but it will only fire if there are no players in the room incase you do decide that you prefer that route:
Code:
Type: Random Numeric Arg: 100 wait 300 s set room %self.room% if %room.people% set people %room.people% while %people% if %people.is_pc% halt else set people %people.next_in_list% end done end if !%self.contents% %load% mob <insert mob vnum> else set curr_item %self.contents% while %curr_item% if %curr_item.vnum% == 59320 halt else set %curr_item% %curr_item.next_in_list% end done %load% mob <insert mob vnum> end
Last edit: 05 Apr 2013 15:29 by Fizban.
The following user(s) said Thank You: zusuk

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
05 Apr 2013 16:10 #1799 by Silvaria
Replied by Silvaria on topic I've got another one..
Hmm. Seeing as this is a nature-temple-themed zone, I do have a nymph mob that will be used as a shopkeeper. She will have another trigger set to her that makes her load only if a player is in the room her shop is in.

Can I use the same mob vnum for this trigger? Or can she not be loaded in two places at once if she's a shopkeeper? (I haven't made it to the medit menus yet, I'm actually REALLY jumping the gun on trying to figure out triggers lol)

Anyway, if the mob who is also the shopkeeper can't be used, I could technically make a separate mob that has identical appearances, and have her pop into the room every few minutes and "tend to the rose bush", which is the container. When she's done "tending", a new rose will be present. But this should only even occur if the container goes 5 minutes of being empty - it shouldn't happen at all if the container has a rose in it.

Probably not a bad idea to make it purge other things that are put inside, unless there's a way to keep people from putting random stuff in there....

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
05 Apr 2013 16:34 #1800 by Fizban
Replied by Fizban on topic I've got another one..

Silvaria wrote: Can I use the same mob vnum for this trigger?


Certainly, you'd just need to have the load script on her have a check for the vnum of the room she is currently in and then have her load a rose and put it in the container if she is in the appropriate room.

Silvaria wrote: unless there's a way to keep people from putting random stuff in there....


That should be fairly trivial actually.

I'll be idling on TBA, if you page me when you log on later though and I hear it I should be able to give you a hand in getting it set up and working if needed.

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

Time to create page: 0.224 seconds