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 ➜ about affects...

about affects...

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


Posted by TehL33TJim   (12 posts)  Bio
Date Thu 28 Jun 2007 01:25 PM (UTC)
Message
Using SmaugFUSS, how would I go about showing affects when a player looks at another? I'm pretty sure I wanna put it at line 861 in act_info.c, but what all should I put?
I tried "show_visible_affects_to_char", that didn't work, which I didn't expect to...

For instance, when I look Jim, currently it would say:

He isn't too interesting...
Jim is 5'4" and weighs 131 pounds.
Jim is in perfect health.

[Jim's Equipment]
.------------------------------------------
[currently held] The Adventurer's Guide


What I want it to do is, assuming Jim has the affect "dead" and it shows " *A halo calmly rests above Jim's head*

So I want it to show:

He isn't too interesting...
Jim is 5'4" and weighs 131 pounds.
Jim is in perfect health.
*A halo calmly rests above Jim's head

[Jim's Equipment]
.------------------------------------------
[currently held] The Adventurer's Guide




So how would I go about doing this?
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Thu 28 Jun 2007 01:29 PM (UTC)
Message
Just grep for where the "is in perfect health." part is and add it after that.

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

Posted by TehL33TJim   (12 posts)  Bio
Date Reply #2 on Thu 28 Jun 2007 01:35 PM (UTC)
Message
What all should I put in though?

void show_visible_affects_to_char? Doesn't seem right...
Top

Posted by Gohan_TheDragonball   USA  (183 posts)  Bio
Date Reply #3 on Fri 29 Jun 2007 11:12 AM (UTC)

Amended on Fri 29 Jun 2007 11:17 AM (UTC) by Gohan_TheDragonball

Message
placing something in show_visible_affects_to_char will allow that item to be viewed at all times, both when someone is just looking in the room and when looking specifically at somebody. if you just want the affect to be visible when looking in a room in general i.e. no arguments given when typing look, then you would want to place it only in show_char_to_char_1(), if you want it soley seen when looking at someone specifically, you would place it only in show_char_to_char_0().

for instance i have halos visible in both scenarios, so my halo line is in show_visible_affects_to_char().
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #4 on Fri 29 Jun 2007 11:16 AM (UTC)
Message
Because, naturally, those function names just make so much sense. :-P

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Samryn   United Kingdom  (60 posts)  Bio
Date Reply #5 on Mon 02 Jul 2007 03:13 AM (UTC)
Message
Affect dead? You have a position dead but not affect unless you've added it.

however, if you want your affects to be displayed you'll have to look for a function called:
show_char_to_char_1

In act_info.c

Basically what Gohan_TheDragonball was trying to say is, this is what is called when you type "look <characters name>".
and just to clear things up, show_char_to_char_0 is like displaying "look" without any specific target.

Anyway, in the function show_char_to_char_1 you will need to locate:
show_condition( ch, victim );

This is the part that displays the:
Jim's in perfect condiction.

You will then have to write a new function in, or begin coding from that spot. You cant use the function show_visible_affects_to_char because this only displays them which you see when you type "look". such as "glows with an aura of divine radiance." which is sanc...

You can however use that function as a reference to create your new displays =) hope this helps.

Samryn Medri
Top

Posted by TehL33TJim   (12 posts)  Bio
Date Reply #6 on Wed 04 Jul 2007 11:37 PM (UTC)
Message
"dead" was an affect that I added on my own, but for the sake of not confusing, lets say I want to use sanctuary [and that I'm of a positive alignment].

When I "look self" [or for other's, "look Jim"] it currently shows this:

He isn't too interesting...
Jim is 5'4" and weighs 131 pounds.
Jim is in perfect health.



However, what I want to acheive [assuming I am affected by sanctuary and have a positive alignment] is this:

He isn't too interesting...
Jim is 5'4" and weighs 131 pounds.
Jim is in perfect health.
*Jim glows with an aura of divine radiance.


I want to have the affects that show up under the player's name and description when you "look" also show up when you "look playername". Can this be done without having to write up a mess load of code? Can I just insert a line of code after "show_condition( ch, victim );"? I really don't know how else I can word this...
Top

Posted by Samryn   United Kingdom  (60 posts)  Bio
Date Reply #7 on Thu 05 Jul 2007 12:08 AM (UTC)
Message
You could add: show_visible_affects_to_char( victim, ch );

However this is what you will have to do...
You will have to add a new affect to the the list, which will be your affect "dead".

This also means when someone types LOOK they will also see the affect message of the person too, unless you take this out of look.

so lets say you add this:


   if( IS_AFFECTED( victim, AFF_DEAD ) )
   {
      set_char_color( AT_WHITE, ch );
      if( IS_GOOD( victim ) )
         ch_printf( ch, "A halo calmly rests above %s's head.\r\n", name );
      else if( IS_EVIL( victim ) )
         ch_printf( ch, "Some horns appear on the top of %s's head.\r\n", name );
      else
         ch_printf( ch, "%s has wings coming from the back of them.\r\n", name );
   }


This will also display this when you type look:
Room Name
Room Description
Exits
Jim the adventure is standing here.
A halo calmly rests above jim's head.

Does this make sense?

Samryn Medri
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.


27,646 views.

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.