Welcome to the Builder Academy

Question re: echoing object variables

More
06 Aug 2020 22:02 #8827 by zi
Replied by zi on topic re: echoing object variables
ugh. so i pasted the entire script above, is that not enough??? sorry, I'm frustrated after months of asking a very specific question, i'm getting "but what are you doing?"

I think i said it a few times, but i have a quest master mob that is taking in objects, 10 to be exact, and using- sorry- remoting a binary string (1111111111 is complete, 0000000000 is empty) to a player file depending on the objects they turn in.

so I have NO problem writing to the binary string (keeping track of what objects were given to the quest master.

you give object 6? great, your string is now 0000010000

then you give object 10? 0000010001

hey.... objects 1,3,5? 1010110001

that's what i'm doing, and I don't need help with that. I'm trying to get my quest master to calculate the missing objects and then output their short descriptions or names.

To simply it, I asked: can you write a script that prompts the player for a number and then uses that number to output variables for rooms/objects/mobs. Cause that's the only part I need to work.

Conceptually, it looks like this:

Hi, give me a number?

500

that's room: The Cleric's Dressing Room
that's object: the odd sceptre
that's mob: minor demon

again- I'm looking to create a variable, assign it a vnum, identify as an item, and echo its name.

can that be done?

_,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,_
Making 3M Great Again!
telnet://3m.funcity.org:3000
_,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,_

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

More
09 Aug 2020 18:30 - 10 Aug 2020 22:53 #8828 by Parnassus
I'm not a coder or a good builder so I can't answer that question. I've worked out a trigger that generates your list but only by inputting all the information manually. Although it's not what you're looking for, maybe you can use parts of it anyway.
Code:
1) Name : Cyborgparts trigger 2) Intended for : Mobiles 3) Trigger types: Receive 4) Numeric Arg : 100 5) Arguments : 6) Commands: wait .5s * We're not a dump. Refuse any other object. if %object.vnum% < 3081 || %object.vnum% > 3087 return 0 wait .5s say That doesn't fit in the pattern. emote returns the item. halt end wait .5s * Set up the variables and check to see if we already have the piece. if !%actor.varexists(cyborgparts)% set cyborgparts 0 remote cyborgparts %actor.id% end set cyborgparts %actor.cyborgparts% eval cyborgpiece %object.vnum%-3000 say Hey, thanks for %object.shortdesc%, %actor.name%! emote consults a list. * Accept or reject the part. if %cyborgparts% /= %cyborgpiece% say Eh, you already gave me this part. drop %object.name% halt else say Oh nice, I needed this part! emote checks the list again. wait .5s end %purge% %object% * Keep a record of what has already been accepted. set cyborgparts %cyborgparts%_%cyborgpiece% remote cyborgparts %actor.id% * Check to see if quest is finished or not. if %actor.varexists(cyborgcount)% say WTF! You did it! Have a gazllion exp or whatever... rdelete cyborgparts %actor.id% rdelete cyborgcount %actor.id% else say You still have to get me some cyborg parts, such as: set q 3081 while %q% < 3088 eval cyborgpiece %q%-3000 if !%actor.cyborgparts.contains(_%cyborgpiece%)% %load% obj %q% say %lastloaded.shortdesc% %purge% %lastloaded% eval cyborgcount %cyborgcount% + 1 end eval q %q% + 1 done if %cyborgcount% < 2 remote cyborgcount %actor.id% say Oh, goodness! That will be the last part! end end

I used items from zone 30 as a test. You can see that the list is inefficient but it would have taken me much longer to have worked out a better way to do it. A loop would have saved some lines.
Last edit: 10 Aug 2020 22:53 by Parnassus. Reason: Input the loop.

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

More
09 Aug 2020 20:50 - 09 Aug 2020 21:03 #8829 by thomas
Replied by thomas on topic re: echoing object variables
If I understand you correctly, you're after a way to get an object description from the corresponding vnum.

Loading the object is probably easiest:
Code:
%load% obj %objvnumhere% %echo% %lastloaded.name% %purge% %lastloaded%
Last edit: 09 Aug 2020 21:03 by thomas.

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

More
10 Aug 2020 00:53 #8830 by Parnassus
Oooh, Thomas! What a cool idea. It seems so simple but I would never have thought of it. And it would work in very nicely with a loop in my trigger. I'm keeping that one for my frankentriggering file :)

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

More
10 Aug 2020 18:55 #8831 by zi
Replied by zi on topic re: echoing object variables
ohhhh ok ok ok ok okayyyyyy. good idea. also, glad i'm not the only one with a snippets text file... ;)

_,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,_
Making 3M Great Again!
telnet://3m.funcity.org:3000
_,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,_

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

More
10 Aug 2020 23:08 #8833 by Parnassus
Okay, I've changed that trigger to use Thomas' bit. I quite like it. It might not be what you're looking for, Zi, but I'm thinking it's a handy trigger that will probably turn up somewhere in one of my zones so thanks for the idea.

For anyone confused by my mention of frankentriggering, it's my method. If you need more info on it, I explain it here .

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

Time to create page: 0.213 seconds