about affects...

Posted by TehL33TJim on Thu 28 Jun 2007 01:25 PM — 8 posts, 29,345 views.

#0
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?
USA #1
Just grep for where the "is in perfect health." part is and add it after that.
#2
What all should I put in though?

void show_visible_affects_to_char? Doesn't seem right...
USA #3
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().
Amended on Fri 29 Jun 2007 11:17 AM by Gohan_TheDragonball
USA #4
Because, naturally, those function names just make so much sense. :-P
United Kingdom #5
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.
#6
"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...
United Kingdom #7
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?