This is just cut out of my code, which is the description of a mob. And yes the vars have be pre-defined.
desc = "[name], [sstatus]([religion])"
Getting errors
error:sstatus:invalid variable
error:religion:invalid variable
error::expected a constant expression
Any ideas how to correctly get these vars to show?
LJR
ID:150232
![]() Nov 23 2001, 7:32 pm
|
|
Ok here the the complete area of code, I knew that. I'm looking for the correct format or way of aug my predefined vars.
mob/male icon = 'pc.dmi' desc = "[name], [sstatus]([religion])" gender = "male" cgender = "Male" |
LordJR wrote:
Ok here the the complete area of code, I knew that. I'm looking for the correct format or way of aug my predefined vars. |
FIREking wrote:
LordJR wrote:Is that to say its simply wrong syntax? Or there is a way to do it, just not that way? Why can't I use var data in my desc? Its already being done for the Name. LJR |
its bad syntax
mob var stat1 stat2 verb SetYourDescription() name = input("Whats your name?") stat1 = input("What kind of food ya like?") stat2 = input("whats your fav song?") desc = "[name] loves to eat [stat1], and listens to [stat2]" |
Ok instead of getting away with it with desc. I just added the information into a Who() verb for mobs.
This code works fine for showing everyone in the game by name, but I'd also like to include the 2 other variables. Right now it will show those other variables as ur own. Can someone tell me how to get the correct set of variables to show up listed next to the names? And just adding M. to the front of those other 2 within the []s is not the answer unless there is some more defining code to go alone with it. Who() usr << " Current people in the world of Kemet:" for(var/M as mob in world) usr << "[M], [M.sstatus]([M.religion])" LJR |
mob
desc = whatever you put here
you have to have it in
mob
New()
desc = whatever you put here
or in another proc
the reason being
mob
var
something
desc = something
this returns a somewhat similiar error, because the variables ALWAYS have to be initially set, and setting desc to something, means that initial setting isnt constant, so it returns an error.
hope this helps.
FIREking