User Name:


Forgot your password?
Vote for Us!
Nov 28, 2018, 10:10 am
By Keirath
First Immortal
Oct 12, 2018, 12:02 pm
By GatewaySysop
Bug in do_climb( )
Jun 5, 2018, 5:31 pm
By joeyfogas
question on overland code
May 31, 2018, 10:03 am
By joeyfogas
KaVir's Protocol Snip
May 15, 2018, 7:57 pm
By joeyfogas
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Sogou, DotBot, Bing

Members: 0
Guests: 21
Newest Member
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » Mob Variables
Forum Rules | Mark all | Recent Posts

Mob Variables
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Dec 19, 2005, 10:59 pm
Go to the top of the page
Go to the bottom of the page


JoinedDec 13, 2005

Hello again,

I finally got the mob variable snippet to work in a limited manor. I striped out the pointer abilites out of it till i can get this to work the way i want. The problem Im having is the scope of these variables. When the mob runs the program it works great but as soon as you go to use the variable in another prog on the same mob its gone allready. Example. Set Setvar 1 $n when char enters room. When char leaves room check $1 OPPS its unset.
If I remove the reset functions for the variables out of mprog_driver then the variables are shared with all mobs and that just wont work. Either i have the reset function in the wrong place in mprog_driver or this just wont work for me with out some redoing. What i would like to do is set the variables to the mob and only have them reset when the mob dies or the var is reset with setvar. I would need this so each instance of the mob could have different variables. How would I go about doing this. Would i have to actually set new variables for mobs in general and then have the setvar function set the ch->var1 etc. Where in the code would i have to add these variables so mobs would have them. Thank you in advance.
Post is unread #2 Dec 20, 2005, 4:33 pm
Go to the top of the page
Go to the bottom of the page

Black Hand
JoinedJan 1, 2002

I'm not familiar with this snippet so I'm not sure exactly what's going on but doesn't sound right for it to reset a variable you set on an affected mob. What does the statement for setting the variables look like? You might be right about it needing to be ch->var1 etc.
Pages:<< prev 1 next >>