best medical school essay editing service essay on how to write an essay how to write a movie in a paper how to write an interesting essay

re: echoing object variables

More
2 months 2 weeks ago #8732 by zi
re: echoing object variables was created by zi
EVERYTHING IS TRIGGERS!

I've tstat'ed * and now I'm turning to you!

Running a quest where the character has to retrieve 10 parts. Using a long elseif seemed wasteful, so I have one variable (cyborgparts) which starts as 0000000000 and when a character gives the questbot a part, he checks cyborgparts and if he accepts the piece, puts a 1 in there.

Here's the hard part. I'm having problems having the script return the shortdesc (or name) of the outstanding parts.

say You still have to get me some cyborg parts, such as:
set q 0 *set timer to 0*
while %q% < 10 * run through all 10 numbers in cyborg parts variable*
if %cyborgparts.charat(%q%)% == 0 *default is 0, the char doesn't have*
eval calc 12825 - %q% *I know this works because I can echo q and match the missing part vnum*
eval stuff %obj.id(%calc%)% *making shit up - get help from pros*
say vnum %calc%... %stuff.name% also known as %stuff.shortdesc% *tell player which parts are missing*
eval q %q% + 1 *roll up counter*
else *already has the part, really means charat found a 1*
eval q %q% + 1 *roll up the counter*
end
done


What am I missing? I THOUGHT trig 308 was the key, but I had a hard time translating it's function.

I'm new to triggers and appreciate any help (and kind words)!!! THANK YOU!

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

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

More
2 months 1 week ago #8746 by zi
Replied by zi on topic re: echoing object variables
Any thoughts on this?

I was very pleased to figure out how to parse a variable to keep track of multiple items in a quest- and very disappointed I couldn't figure out how to take a variable, make it identify as an item, and echo its name.

Any help would be appreciated!

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

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

More
2 months 4 days ago #8768 by Parnassus
Replied by Parnassus on topic re: echoing object variables
I'm surprised that you're using 308 as an example since I've tried it and didn't actually see it doing anything. t1332 uses shortdesc variables and might be more helpful. If you look at t152, you'll see that Angel checks the object type and the vnum of the object and returns an emote using the object shortdesc.

It's hard to see exactly what's going on with your trigger since the clip is so short. You used "say" to see the outcome of the variables and that's really good! You may find it easier to use %echo% since some trigger types don't recognize "say". It would be helpful to see what was returned (what was said).

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

More
4 weeks 11 hours ago #8812 by zi
Replied by zi on topic re: echoing object variables
Here's the code:

*TEMP TRIGGER 12899*
set cyborgparts %actor.cyborgparts%

say Hey, thanks for the %object.name%!
eval inside 12825 - %object.vnum%
if %cyborgparts.charat(%inside%)% == 1
say Eh, you already gave me this part.
drop %object%
elseif %cyborgparts.charat(%inside%)% == 0
say Oh nice, I needed this part!
%purge% %object%

*build a new cyborgparts*
eval i 1
eval newflag
while %i% < 11
if %i% == %inside%
eval digit 1
else
eval digit %cyborgparts.charat(%i)%
end
eval newcyborgparts %newcyborgparts%%digit%
eval i %i% + 1
done

eval cyborgparts %newcyborgparts%
remote cyborgparts %actor.id%

if %actor.cyborgparts% == 1111111111
say WTF! You did it! Have a gazllion exp or whatever...
else
say You still have to get me some cyborg parts, such as:
set q 0
while %q% < 10
if %cyborgparts.charat(%q%)% == 0
eval object 12825 - %q%
say %q% %object.name%
eval q %q% + 1
else
eval q %q% + 1
end
done
end

else
return 0
end






My Output from my mortal tester is:

357H 550M 149V > give leg quest
The Quest Cyborg says, 'Hey, thanks for the cyborg right leg!'
The Quest Cyborg says, 'Oh nice, I needed this part!'
The Quest Cyborg says, 'You still have to get me some cyborg parts, such as:'
The Quest Cyborg says, '3 Eastern Edge of the Combat Training Hall '
The Quest Cyborg says, '5 North-East Corner of the Combat Training Hall '
The Quest Cyborg says, '6 Northern Edge of the Combat Training Hall '


SOOOOOOOOoooooooo
how I can I grab a number and output all the variables to that vnum as an object (or a room, or mob for that matter)...

(also - say/echo/send gives me the same result, it's a formatting issue so I'm not fixing it until the core code is sturdy)

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

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

More
1 week 5 days ago #8816 by zi
Replied by zi on topic re: echoing object variables
how I can I grab a vnum and output all the variables to that vnum as an object (or a room, or mob for that matter)????

It doesn't have to be in a 'say' - can be in an echo or send. can this be done?

Another way to approach this is: can YOU write a script that cycles through a list of numbers, 1-10 and then give short descriptions as objects, room names, and mob names (assuming there's a mob, room, and object with a vnum of 1,2,3,4,5,6,7,8,9,10)

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

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

More
1 week 5 days ago #8819 by Parnassus
Replied by Parnassus on topic re: echoing object variables
I think I still don't have enough information. For instance, what are those answers that look like room names? Are they from rvnums? Also, I need to know exactly what he's looking at. You can give me that by adding in says or echos for every variable that changes, showing me the output of the variable before AND after it changes.

This should look something like:
say Variable <variable name> = %whatever the variable is%.
eval <variable name> (add in the eval here)
say Variable <variable name> has changed to : %whatever the variable is now%

If you do this for EVERY variable in your list, I might be able to see something. As it is, you know what they're talking about because you wrote it. I haven't a clue what your code means. This is why I never expect people to understand what my triggers are doing :)

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

More
5 days 2 hours ago #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
2 days 6 hours ago - 1 day 2 hours ago #8828 by Parnassus
Replied by Parnassus on topic re: echoing object variables
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.
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: 1 day 2 hours ago by Parnassus. Reason: Input the loop.

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

More
2 days 4 hours ago - 2 days 3 hours ago #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:
%load% obj %objvnumhere%
%echo% %lastloaded.name%
%purge% %lastloaded%
Last edit: 2 days 3 hours ago by thomas.

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

More
2 days 3 minutes ago #8830 by Parnassus
Replied by Parnassus on topic re: echoing object variables
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
1 day 6 hours ago #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
1 day 1 hour ago #8833 by Parnassus
Replied by Parnassus on topic re: echoing object variables
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.195 seconds