ID:157303
 
mob/Login()
usr << sound ('offtoneverland.ogg')

mob/nation/var
Furion = 0
Ancient = 0
Arcadian = 0
Sky_Pirate = 0

turf/New
icon='New.bmp'
layer=3
Click()
var/list/nations = list("The Arcadians","The Ancients","Sky Pirates")
if(prob(30))
nations+= "The Furions"
switch(input("Select Your Nation.") in nations)

if("The Arcadians")
usr.icon='player.dmi'
usr.icon_state="male"
usr.loc=locate(148,28,4)
nation.Arcadian +=1

if("The Ancients")
usr.icon='player.dmi'
usr.icon_state="male"
usr.loc=locate(102,28,4)
nation.Ancient +=1

if("Sky Pirates")
usr.icon='player.dmi'
usr.icon_state="male"
usr.loc=locate(188,28,4)
nation.Sky_Pirate +=1

if("The Furions")
usr.icon='player.dmi'
usr.icon_state="male"
usr.loc=locate(248,28,4)
nation.Furion +=1

turf/Finished
icon='Finished.bmp'
density=1
opacity=1
layer=7
Click()
usr.loc=locate(/turf/landscape/start)
usr << sound(null)
sleep(50)
if "The Arcadians" = 1
usr.loc=locate(/turf/landscape/start)
usr << sound('songa.midi')
if "The Ancients" = 1
usr.loc=locate(/turf/landscape/start)
usr << sound('songb.midi')
if "Sky Pirates" = 1
usr.loc=locate(/turf/landscape/start)
usr << sound('songc.midi')
if "The Furions" = 1
usr.loc=locate(/turf/landscape/start)
usr << sound('songd.midi')



hows this looking, do i look to be on the right tracks?
nation += Arcadian ==1


What
and

if "The Arcadians" = 1


That won't even compile. Or work how you want it to.
= is used to set a value
== is used to compare values
You're checking whether a text string equals 1, when you should be checking whether the nation variable equals the string.

if(usr.nation=="The Arcadians")
In response to Emasym
Emasym wrote:
> nation += Arcadian ==1
>

What
and

if "The Arcadians" = 1

That won't even compile. Or work how you want it to.
= is used to set a value
== is used to compare values
You're checking whether a text string equals 1, when you should be checking whether the nation variable equals the string.

> if(usr.nation=="The Arcadians")


I see so as an example if i did this

mob/var/nation
"A" = 0
"B" = 0
turf
new
icon='New.bmp'
Click()
"A" += 1
"B" += 0


this one give nation A's var 1? Then assuming this is correct
turf
finish
icon='finish.bmp'
Click()
if("A" == 1)
usr << "success"
if("B" == 0)
usr << "success"


if i did it right it should say success to A and B

else

if that example is wrong im still as dumb as i was 5 minutes ago ^^;
In response to Thorpeous
You're still as dumb, yeah. You're adding 1 to a TEXT STRING. You can NOT do math with a TEXT STRING. A Text String is ALWAYS 'TRUE'. Also, Variables can NOT be text strings.

Also, Boolean (TRUE/FALSE) checks (or 0/1) should be done this way;

var
a
b=1

proc/CheckValues()
if(a) world<<"a has a value"
if(b) world<<"b has a value"


This will output "b has a value", because b has value of 1, and a has no value (null).
In response to Emasym
Emasym wrote:
You're still as dumb, yeah.

Nice motivational speech.
In response to Emasym
Emasym wrote:
You're still as dumb, yeah. You're adding 1 to a TEXT STRING. You can NOT do math with a TEXT STRING.

var 
strA = "blahcake"
strB = "yummy"

world << strA + strB

//alternatively

strA += strB
world << strA


In response to DivineTraveller
I'm talking math here. "[a]"+"[b]" equals "[a][b]" doesn't really qualify. The person in this thread was doing trying to add 1 to "1" to make it 2, which is impossible without text2num(). So don't digress.
In response to Emasym
Emasym wrote:
I'm talking math here. "[a]"+"[b]" equals "[a][b]" doesn't really qualify. The person in this thread was doing trying to add 1 to "1" to make it 2, which is impossible without text2num(). So don't digress.

'twas just a joke.