ID:263389
 
Code:

proc // Indentation Error right here, but that's not the problem
Name()
Prompt = "Character Name"
Help_Text = "Ahh, so your new. What's your name, young one? (Must be RP appropiate, or booted on site)"
char_name = input(Prompt,Help_Text) as null|text
usr.name = char_name
if (usr.name == "") || (usr.name == null)
usr.Name()



Problem description: Well, the error I have gotten with this code is that it's "missing left-hand argument to ||". I try to fix this as much as possible, but I really have no clue, and I need a bit of help. Can anyone help?

Also, for the question:

Is the >> Operator the same as the > Operator? If so, thank you. If not, what is it, and where can it be used? By the way, it was used in this form: if(elecvotes >> highvotesearth && client in candidatesearth)

Thank you.

-Arya V.


   if (usr.name == "") || (usr.name == null)


you dont need the extra set of partensees

 if (usr.name == ""||usr.name == null)


and im not positive what the << operator is, sorry o+o


-Axerob

In response to Axerob
this > operator is greater than, while this < operator is less than << is wrighting to, while >> is reading.

~Grand~
"Is the >> Operator the same as the > Operator? If so, thank you. If not, what is it, and where can it be used? By the way, it was used in this form: if(elecvotes >> highvotesearth && client in candidatesearth)"

I say no. Generally >> is used to read in information from a savefile.
I think that the example there is either a typo or elecvotes is having the value of highvotesearth placed in it(sounds fishy) . Possibly if(elecvotes > highvotesearth && client in candidatesearth)
Please put code inside the >dm> tags.

Additionally, don't use usr in procs. It isn't safe. You should either use src or an argument passed to the procedure, depending on context.

The error in question is coming from this line:
if (usr.name == "") || (usr.name == null)


Look at the parentheses - they're wrong. They should be:
if((usr.name == "") || (usr.name == null))


Finally, the >> operator is definitively NOT the same as >. It's used for two things - first, reading data from a savefile. Second, it's the bitshift right operator.
In response to KillerGrand
I'm sorry to say, guys, that I actually got 86 errors after that.. could it be another problem, and the DM error engine is just screwing around with me?
In response to Arya V.
show the code your trying to do <.<
~Grand~
In response to KillerGrand
world
hub = "Duper.Dragonball Paradox"
name = "Dragonball: Paradox"
status = "Closed Testing"


mob
Logout()
world << "<font color = orange> [usr] has exited the world for some time!"
del(src)

mob
Login()
world << "<font color = orange> [usr] has entered the world!"
switch(input("Dragonball Paradox","Have we met before? Or are you new here?") in list ("New Character","Load Character","Version Update"))
if ("New Character")
usr.Name()
usr.Race()
usr.Hair()
if ("Version Update")
alert("Testing.")


proc
Name()
Prompt = "Character Name"
Help_Text = "Ahh, so your new. What's your name, young one? (Must be RP appropiate, or booted on site)"
char_name = input(Prompt,Help_Text) as null|text
usr.name = char_name
if (usr.name == "") || (usr.name == null)
usr.Name()

Race()
switch(input("Dragonball Paradox","And what origin are you from?") in list ("Human", "Tsurfurijin", "Alien"))
if ("Human")
usr.HumanRace()
if ("Tsurfurijin")
usr.TsurfuRace()
if ("Alien")
usr.AlienRace()


HumanRace()
usr.race = "Human"
usr.age = 1
usr.str = rand (0.02, 0.1)
usr.agi = rand (0.05, 0.15)
usr.cons = rand (0.02, 0.1)
usr.dex = rand (0.05, 0.15)
usr.will = rand (0.05, 0.15)
usr.int = rand (0.05, 0.15)
usr.perc = rand (0.04, 0.13)
usr.BP = rand(0.5, 1)
usr.gunslinging = 0.05
usr.gunslingingmod = 0.06
usr.strmod = 0.02
usr.agi = 0.05
usr.consmod = 0.03
usr.dexmod = 0.05
usr.willmod = 0.05
usr.intmod = 0.06
usr.percmod = 0.04
usr.fly = 0
usr.zanzoken = 0
usr.kiblast = 0
usr.locate(1,1,1)
usr.BPMod = 0.05


TsurfuRace()
usr.race = "Tsurfurijin"
usr.age = 1
usr.str = rand (0.02, 0.1)
usr.agi = rand (0.05, 0.15)
usr.cons = rand (0.02, 0.1)
usr.dex = rand (0.05, 0.15)
usr.will = rand (0.05, 0.15)
usr.int = rand (0.05, 0.15)
usr.perc = rand (0.04, 0.13)
usr.BP = rand(0.5, 1)
usr.gunslinging = 0.05
usr.gunslingingmod = 0.06
usr.strmod = 0.02
usr.agi = 0.05
usr.consmod = 0.03
usr.dexmod = 0.05
usr.willmod = 0.05
usr.intmod = 0.06
usr.percmod = 0.04
usr.fly = 0
usr.zanzoken = 0
usr.BPmod = 0.05
usr.kiblast = 0
usr.locate (1,1,1)

AlienRace()
usr.race = "Alien"
usr.age = 1
usr.str = rand (0.02, 0.1)
usr.agi = rand (0.05, 0.15)
usr.cons = rand (0.02, 0.1)
usr.dex = rand (0.05, 0.15)
usr.will = rand (0.05, 0.15)
usr.int = rand (0.05, 0.15)
usr.perc = rand (0.04, 0.13)
usr.BP = rand(0.5, 1)
usr.gunslinging = 0.05
usr.gunslingingmod = 0.06
usr.strmod = 0.02
usr.agi = 0.05
usr.consmod = 0.03
usr.dexmod = 0.05
usr.willmod = 0.05
usr.intmod = 0.06
usr.percmod = 0.04
usr.fly = 0
usr.zanzoken = 0
usr.BPmod = 0.05
usr.kiblast = 0
usr.locate (1,1,1)


I know, I know.. It's a DBZ game. But at least it's RP! :)

Could this help? Thank you.
In response to Arya V.
world
hub = "Duper.Dragonball Paradox"
name = "Dragonball: Paradox"
status = "Closed Testing"


mob
Logout()
world << "<font color = orange> [usr] has exited the world for some time!"
del(src)

mob
Login()
world << "<font color = orange> [usr] has entered the world!"
switch(input("Dragonball Paradox","Have we met before? Or are you new here?") in list ("New Character","Load Character","Version Update"))
if ("New Character")
usr.Name()
usr.Race()
usr.Hair()
if ("Version Update")
alert("Testing.")


proc
Name()
Prompt = "Character Name"
Help_Text = "Ahh, so your new. What's your name, young one? (Must be RP appropiate, or booted on site)"
char_name = input(Prompt,Help_Text) as null|text
usr.name = char_name
if (usr.name == ""||usr.name == null)
usr.Name()

Race()
switch(input("Dragonball Paradox","And what origin are you from?") in list ("Human", "Tsurfurijin", "Alien"))
if ("Human")
usr.HumanRace()
if ("Tsurfurijin")
usr.TsurfuRace()
if ("Alien")
usr.AlienRace()


HumanRace()
usr.race = "Human"
usr.age = 1
usr.str = rand (0.02, 0.1)
usr.agi = rand (0.05, 0.15)
usr.cons = rand (0.02, 0.1)
usr.dex = rand (0.05, 0.15)
usr.will = rand (0.05, 0.15)
usr.int = rand (0.05, 0.15)
usr.perc = rand (0.04, 0.13)
usr.BP = rand(0.5, 1)
usr.gunslinging = 0.05
usr.gunslingingmod = 0.06
usr.strmod = 0.02
usr.agi = 0.05
usr.consmod = 0.03
usr.dexmod = 0.05
usr.willmod = 0.05
usr.intmod = 0.06
usr.percmod = 0.04
usr.fly = 0
usr.zanzoken = 0
usr.kiblast = 0
usr.locate(1,1,1)
usr.BPMod = 0.05


TsurfuRace()
usr.race = "Tsurfurijin"
usr.age = 1
usr.str = rand (0.02, 0.1)
usr.agi = rand (0.05, 0.15)
usr.cons = rand (0.02, 0.1)
usr.dex = rand (0.05, 0.15)
usr.will = rand (0.05, 0.15)
usr.int = rand (0.05, 0.15)
usr.perc = rand (0.04, 0.13)
usr.BP = rand(0.5, 1)
usr.gunslinging = 0.05
usr.gunslingingmod = 0.06
usr.strmod = 0.02
usr.agi = 0.05
usr.consmod = 0.03
usr.dexmod = 0.05
usr.willmod = 0.05
usr.intmod = 0.06
usr.percmod = 0.04
usr.fly = 0
usr.zanzoken = 0
usr.BPmod = 0.05
usr.kiblast = 0
usr.locate (1,1,1)

AlienRace()
usr.race = "Alien"
usr.age = 1
usr.str = rand (0.02, 0.1)
usr.agi = rand (0.05, 0.15)
usr.cons = rand (0.02, 0.1)
usr.dex = rand (0.05, 0.15)
usr.will = rand (0.05, 0.15)
usr.int = rand (0.05, 0.15)
usr.perc = rand (0.04, 0.13)
usr.BP = rand(0.5, 1)
usr.gunslinging = 0.05
usr.gunslingingmod = 0.06
usr.strmod = 0.02
usr.agi = 0.05
usr.consmod = 0.03
usr.dexmod = 0.05
usr.willmod = 0.05
usr.intmod = 0.06
usr.percmod = 0.04
usr.fly = 0
usr.zanzoken = 0
usr.BPmod = 0.05
usr.kiblast = 0
usr.locate (1,1,1)

That should do it, Also dont use usr in proc
~Grand~

In response to Arya V.
Problems - You're still using usr in procs. In this context, it should be src. Just remove all the usrs in front of variables.

You still haven't fixed your problem, which is this:
if (usr.name == "") || (usr.name == null)


Throw another pair of brackets 'round the stuff inside.

You need to indent under switch() statements.

rand() doesn't work for fractional numbers. You'll have to write this:
usr.str = rand (0.02, 0.1)


As something like this:

str = rand (20, 100)*0.001


What are the errors? After you fix all those, mind.
In response to KillerGrand
Possibly you should have fixed the various other issues, too. For example, you didn't remove the usrs - if you're going to rewrite everything, write it up properly.

Also, you didn't indent under the switches, and those will throw out errors - at the very least, bugs at runtime.
In response to Jp
actually i did i just missed it <.<
~Grand~
In response to KillerGrand
Err.. like I said, if I use this:

if (usr.name == ""||usr.name == null)



gave me 81 errors. It tells me that all my variables are undefined, when they really are. Help?
In response to Arya V.
are you sure there mob/vars and not world/vars.
In response to Arya V.
Actually if Login() is called manually, you should not use usr. Also you should be using if(!src.name) since that = both "" and null. And you should not use usr in a proc.
In response to KillerGrand
Yep, I am. I actually changed the whole usr labels to src, but still get 16 errors, all with not defining a variable, which I did.
In response to Arya V.
what are the 16 errors
In response to KillerGrand
These are the errors:

loading Dragonball Paradox.dme
Variables.dm:14:error:name :duplicate definition (conflicts with built-in variable)
Login.dm:44:error:src.age:undefined var
Login.dm:54:error:src.gunslingingmod:undefined var
Login.dm:62:error:src.fly:undefined var
Login.dm:63:error:src.zanzoken:undefined var
Login.dm:65:error:src.kiblast:undefined var
Login.dm:71:error:src.age:undefined var
Login.dm:81:error:src.gunslingingmod:undefined var
Login.dm:89:error:src.fly:undefined var
Login.dm:90:error:src.zanzoken:undefined var
Login.dm:92:error:src.kiblast:undefined var
Login.dm:97:error:src.age:undefined var
Login.dm:107:error:src.gunslingingmod:undefined var
Login.dm:115:error:src.fly:undefined var
Login.dm:116:error:src.zanzoken:undefined var
Login.dm:118:error:src.kiblast:undefined var
In response to Jp
Jp wrote:
Finally, the >> operator is definitively NOT the same as >. It's used for two things - first, reading data from a savefile. Second, it's the bitshift right operator.

Also, reading data from text files.

Hiead
In response to Arya V.
Have you indented the switches?
Page: 1 2