ID:168582
 
How do i define a var?( i keep forgetting how to >.<)
mob/var
variable = 0


Is that what you need?
mob
var
Num = 0 // This can be any number
Question = TRUE // Or false
Text = "Hey" // Text variable

list\List = list() // List variable
In response to Legacy Warrior
umm i dont think so becuase im getting the error

usr.C: undefined var
Variables.

I suggest you read all of the DM Guide and tutorials also.

~~> Dragon Lord
Well,in this situation like this

mob
var
HP

mob/PC
HP=100


Correct me if im wrong
And if its not your problem ignor this reply


Tainted Spirit

Well,in this situation like this

mob
var
HP

This is how you define one

mob/PC
HP=100

And thats how you give the mob the var.


Correct me if im wrong.
And if its not your problem ignor this reply.


Tainted Spirit

In response to Tainted Spirit
ok i dont think these are really right so.........heres my code the part with usr.C is the undefined var
bj
bush
icon = 'bush.dmi'
icon_state = "bush"
density = 1
verb
Pick_berries()
set src in view(1)
if(usr.C == 0)
usr << "You begin to Pick berries."
usr.C = 1
sleep(25)
usr << "You got some Berries!"
usr.contents+=new/obj/berry
usr.C = 0
else
usr << "alredy Picking"
In response to Nick789
Nick789 wrote:
ok i dont think these are really right so.........heres my code the part with usr.C is the undefined var
obj
> bush
> icon = 'bush.dmi'
> icon_state = "bush"
> density = 1
> verb
> Pick_berries()
> set src in view(1)
var/mob/C=0// Define the var >:)
> if(usr.C == 0)
> usr << "You begin to Pick berries."
> usr.C = 1
> sleep(25)
> usr << "You got some Berries!"
> usr.contents+=new/obj/berry
> usr.C = 0
> else
> usr << "alredy Picking"
>
hope i helped
In response to Echtolion
Ok it defined the var but it says its not used...I think ill take this over to code problems to see if that helps.
In response to Nick789
If I'm not mistaken, wouldn't src.C work better here?
obj
bush
icon = 'bush.dmi'
icon_state = "bush"
density = 1
var/C = 0
verb
Pick_berries()
set src in view(1)
if(!src.C) // Same as src.C == 0
usr << "You begin to Pick berries."
src.C = 1
sleep(25)
usr << "You got some Berries!"
usr.contents+=new/obj/berry
src.C = 0
else
usr << "Alredy Picking"

In response to Popisfizzy
Popisfizzy wrote:
If I'm not mistaken, wouldn't src.C work better here?

It really just depends how Nick wants his berries to be picked. If you did it your way, only one person could pick the berries at once, which might be better for his game. It's the developer's decision though.

~~> Dragon Lord
In response to Unknown Person
I think thats what he said somewhere else.