ID:142576
 
Code:
mob
proc
verbcheck()
if(usr.Dario == 1)
if(usr.Mario == 0)
if(usr.Luigi ==0)
if(usr.Bowser == 0)
if(usr.Peach == 0)
if(usr.Yoshi == 0)
if(usr.DK ==0)
if(usr.Cfalcon == 0)
if(usr.Ganondorf == 0)
if(usr.Falco == 0)
if(usr.Ness == 0)
if(usr.IC == 0)
if(usr.Kirby == 0)
if(usr.Samus == 0)
if(usr.Zelda == 0)
if(usr.Ylink == 0)
if(usr.Link == 0)
if(usr.Pichu == 0)
if(usr.Pikachu == 0)
if(usr.Jigglypuff == 0)
if(usr.Mewtwo == 0)
if(usr.Mr == 0)
if(usr.Marth == 0)
if(usr.Roy == 0)
if(usr.Fox == 0)
// usr.ver

if(usr.Mario == 1)
if(usr.Dario == 0)
if(usr.Luigi ==0)
if(usr.Bowser == 0)
if(usr.Peach == 0)
if(usr.Yoshi == 0)
if(usr.DK ==0)
if(usr.Cfalcon == 0)
if(usr.Ganondorf == 0)
if(usr.Falco == 0)
if(usr.Ness == 0)
if(usr.IC == 0)
if(usr.Kirby == 0)
if(usr.Samus == 0)
if(usr.Zelda == 0)
if(usr.Ylink == 0)
if(usr.Link == 0)
if(usr.Pichu == 0)
if(usr.Pikachu == 0)
if(usr.Jigglypuff == 0)
if(usr.Mewtwo == 0)
if(usr.Mr == 0)
if(usr.Marth == 0)
if(usr.Roy == 0)
if(usr.Fox == 0)
// usr.ver


Problem description:

uhhh the 2nd main branch its the first if of the second part and its if(usr.Mario == 1) it says its invalid for some reason and i know theres alot of if's so if there is another way to do this please tell me =\

This is one of the most thoughtless, worse implementations ever. Did you plan to make a variable for every Pokemon out of the 300+ (or whatever they already got to) ones? Ridiculous.
Your proc is also ridiculous, don't use the == and != operators to check boolean variables. Don't make a ridiculous amount of variables for one purpose. Don't make a ridiculous amount of checks and use the && (and ||) operator for multiple checks.
It probably wouldn't hurt you to read all this either.
http://www.byond.com/members/ DreamMakers?command=view_post&post=40355
In response to Kaioken
that's not going to answer the first question i had is it?

PS: this is not a pokemon game there are only 15 characters NOT 300 -.-
PSS: having bad codes is good because it means 1 thing:
i don't steal other codes i make my own -.-x2
PSSS: i did ask nicely
PSSSS: making mistakes is good because you CAN learn from them
Okay, are you trying to see if a player is a certain character? There's an infinitely better way to do that:
#define MARIO 1
#define DARIO 2
//Add the rest here.

mob/var/character //For example, set this equal to MARIO or whatever character.

Do than and check that way, not with an awful series of ifs.
In response to Popisfizzy
so i have it like...
mob/var/characer = none
mob
turf
choosemario()
if(usr.character == none)
usr.character = mario
mob
proc
verbcheck()
if(usr.character == mario)
// usr.verbs +=
if(usr.character == dario)
// usr.verbs +=

right?
In response to SadoSoldier
one more question on usr.character = mario how do i define mario since its on the right side? defining a definition i dont understand

Edit: nvm i already had it defined but the thing is if usr.Mario = 1 then if(usr.character == Mario) wouldnt that mean that as soon as he logs on his character = mario? since when he logs on its defined as 0
In response to SadoSoldier
Well, if you're going to do it that way, it would be best just to create mob/Mario, mob/Dario, etc. and give the verbs there. Then create a new /mob and assign client.mob to that mob.
In response to Popisfizzy
?_? can u show me in code form
In response to SadoSoldier
client/proc/assign_new_type(typepath)
var/mob/m = mob.client
mob.client = new typepath

del m
In response to SadoSoldier
mob/character
Charmander
verb/Fireball()
Squirtle
verb/Water_Gun()


This isn't a good way to handle attacks, but this is just an example of defining verbs on subtypes. What verbs are you adding on your checks, etc? If we know exactly what you're trying to do we will know better what method will get it done well.
In response to Popisfizzy
Popisfizzy wrote:
> client/proc/assign_new_type(typepath)
> var/mob/m = mob.client
> mob.client = new typepath
>
> del m
>


I'm confused. Are you setting a new client, and then deleting the client? :o

Hiead
In response to Hiead
I think he meant to just write "mob" instead of "mob.client"
In response to Hiead
Hiead wrote:
Popisfizzy wrote:
> > client/proc/assign_new_type(typepath)
> > var/mob/m = mob.client
> > mob.client = new typepath
> >
> > del m
> >

I'm confused. Are you setting a new client, and then deleting the client? :o

Heh, he got very confused himself in the 2 instances he's accessing object variables. It should actually be-
> > client/proc/assign_new_type(typepath)
> > var/mob/m = src.mob //keep a reference to the current mob so it can be deleted later (if you delete it now it will log the player out)
> > src.mob = new typepath //set/connect a new mob to the player (client)
> >
> > del m //delete the old mob
> >
In response to Hiead
As Garthor said, I just meant to do mob and not mob.client. It was 2:30 and I was tired, so I should've looked over my post a bit more before I posted it.
In response to SadoSoldier
SadoSoldier wrote:
that's not going to answer the first question i had is it?
No, but it will help you a whole lot in the future - if you follow his advice.
PS: this is not a pokemon game there are only 15 characters NOT 300 -.-
Doesn't matter. 15 is still a lot and even if it was only 2 it should still be done this way. Besides, what if you want to add more characters later? Looks like it would be a pain to code in.
PSS: having bad codes is good because it means 1 thing:
i don't steal other codes i make my own -.-x2
I guess so...
PSSS: i did ask nicely
PSSSS: making mistakes is good because you CAN learn from them
Yes, but only if you DO learn from them and fix them :)