Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Polymorph And Player names

Polymorph And Player names

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1 2  

Posted by Jynxdarkspell   USA  (16 posts)  Bio
Date Sat 24 Feb 2007 08:39 PM (UTC)
Message
I am using the polymorph code for a couple of my new classes, but I was wondering, is there a way to have it actually show the players name instead of the long description of the polymorph? Like "$n is morphed into a whatever". Any help on that is much appreciated. Running Smaugfuss 1.7 with mucho snippets, and so far everything looks beautiful!
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Sat 24 Feb 2007 08:55 PM (UTC)
Message
Are you doing this via the code, or no?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Jynxdarkspell   USA  (16 posts)  Bio
Date Reply #2 on Sun 25 Feb 2007 06:38 AM (UTC)

Amended on Sun 25 Feb 2007 06:43 AM (UTC) by Jynxdarkspell

Message
Well, whichever way works the best, and that'll probably be code related. I mean If I look through the code in comm.c or act_info.c long enough, I'm sure I could figure out a sloppy way to do it, but I'd rather not be sloppy. It'd be nice if the command worked like "setmorph lycan4 long &z$n is transformed into a Stage 4 Lycan.&d", but like I said, any help is appreciated, and looking more closely, I think I'm actually working with a smaugfuss 1.6 base. I'll give you an example of what I hope to get accomplished :) maybe that'll narrow it down :)


<start example>
Crow's Loft [ - ]
-<----------------------------------------------->- [<---(*)-D->]
[ _ ]

You have entered the private sanctuary of Crow. This is where
he comes to get away from it all. The walls are painted black
with a blood red trim surrounding the windows, doors, and floor.
The carpet underneath your feet appears to be of oriental descent.
Standing in the center of the room is Crow's Coffin. Down will
lead you back to the Parlour Of The Immortals.
Exits: none.
A gigantic black "Lovesack" is here for you to sit on.
A red coffin with black trim adourns the center of the room.
Lucian is Hard at Work is standing here.
Lucian is transformed into a Stage 4 Lycan.

[10044hp 42bp 29900] [1201][]

<end example>

I don't know, i mean I suppose if I look more at the flameshield code? Anyways, just hoping someone may have the answer for me so I can make this turn out nice :)

Appreciate it :)

By the way Zeno, I notice you reply to lots of the people's posts, thank you man :)
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #3 on Sun 25 Feb 2007 06:50 AM (UTC)
Message
In that case, you'd need to parse setmorph to handle variables. You could probably look over the act function to see how that is done.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Jynxdarkspell   USA  (16 posts)  Bio
Date Reply #4 on Sun 25 Feb 2007 05:25 PM (UTC)

Amended on Sun 25 Feb 2007 05:26 PM (UTC) by Jynxdarkspell

Message
Sounds like a great start, but which act function should I get the example from?
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #5 on Sun 25 Feb 2007 06:01 PM (UTC)
Message
There's only one act function. If not, then the one called "act" (there might be "act2" although that may just be my MUD).

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Jynxdarkspell   USA  (16 posts)  Bio
Date Reply #6 on Sun 25 Feb 2007 06:15 PM (UTC)
Message
And the act functions can be found in which file, bud?
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #7 on Sun 25 Feb 2007 06:23 PM (UTC)
Message
Not sure offhand. You could grep for it, or check mud.h for the prototype and you'll find a comment saying what file it's in.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Jynxdarkspell   USA  (16 posts)  Bio
Date Reply #8 on Sun 25 Feb 2007 06:51 PM (UTC)
Message
Thank you Zeno :) I'll see what I can dig up :)
Top

Posted by Orik   USA  (182 posts)  Bio
Date Reply #9 on Mon 26 Feb 2007 04:39 PM (UTC)
Message
I think if you look in act_info.c in either show_list_to_char or show_list_to_char1 or something along those lines. You mentioned looking at the flameshield code. Search for that part then under it put something like:

if (IS_POLYMORPHED(victim))
sprintf( %s is a %s, victim->name, victim->race);

Something along those lines. That code is not correct in anyway or form, but it gives you an idea of what you could do.

Look at the flameshield peice in the show_to functions. I can't remember which one. See how it works and then create your polymorph if statement.

You might want to search for polymorph and see if there's a polymorph if statement somewhere that you can work off of and put it into your act_info file.

Again, my example was just pseudocode. I can't really remember how exactly to write it as I don't have code in front of me, but that's kind of a basic outline.

I'm sure someone will correct me. :)
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #10 on Tue 27 Feb 2007 01:29 PM (UTC)
Message
I believe Jynxdarkspell wants to actually code something to parse variables in the string, not hardcode it in.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Orik   USA  (182 posts)  Bio
Date Reply #11 on Tue 27 Feb 2007 02:29 PM (UTC)
Message
Yea, I just reread the first post. That is what he's wanting.
Top

Posted by Jynxdarkspell   USA  (16 posts)  Bio
Date Reply #12 on Tue 27 Feb 2007 03:24 PM (UTC)
Message
Well, so far it's coming out the way I wanted it to. There was alot of stuff I noticed in polymorph that didn't quite work right, such as hps. By default it's coded to raise or lower your current hp, not your max hp, so if you have a level restore like I do, when you leveled and got restored, your hitpoints returned to their normal max. I added a max_hit call to the morph structure, along with a max_mana and a max_move to get that taken care of. I had to change the way the show_char_to_char stuff worked, and I coded in a "shockshield" like flag in build.c and created a "shockshield" like speel to show players what I want them to see. It looks and works real well, but now we come to another problem, albeit slight. When a morphed character speaks, it shows the short desc of the morph saying it, i.e. "A stage 1 lycan says 'blah'" I'm trying to figure out how to get it to show the players name says instead of the morph short desc says, and I'm a little stumped.... I've looked at the do_say function, I've looked in comm.c and I'm just not seeing it. Any ideas folks?
Top

Posted by Orik   USA  (182 posts)  Bio
Date Reply #13 on Tue 27 Feb 2007 04:49 PM (UTC)
Message
Search for "says" I can't exactly remember but I think it has to do with talk_channels or something like that. There's probably an if statement to see if they are polied. I'm thinking that all the other chat channels and such go through the talk_channels.
Top

Posted by Jynxdarkspell   USA  (16 posts)  Bio
Date Reply #14 on Tue 27 Feb 2007 07:13 PM (UTC)
Message
The line that does the say to the room:

act( AT_SAY, "$n says '$t'", ch, sbuf, vch, TO_VICT );

found in act_comm.c

The code surrounding it has no mention of morphs. Still looking for the answer.....
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


45,487 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.