ID:145585
 
Code:


Problem description:

Okay, I'm trying to make a new character creation (maybe its been done i don't know, but i cant find a demo or a lib on in anywhere)i want to make it that instead of choosing your character class at initial LOG IN, you have to find the right guy to talk to... i can make it so your icon changes but the actual class does not!
...........................................................
classguy
icon = 'class.dmi'
verb
talk()
set src in view()
var
switch(class)
class = input("What Are You?") in list ("Pilot","Soldier")

if(class =="Pilot")
usr<<"Okay so your a pilot?"
/mob/PC/pilot
if(class == "Soldier")
usr<<"We have a mighty soldier!"
usr.icon = 'soldier.dmi'
usr.loc = locate(1,1,5)

...........................................................

The soldrier one only changes the icon, while the pilot one in theory should change the actual class... should i just change all vars through this as well as the icon?
Oh, I'm doing that on my Morrowind game. Try this.

       Guard3
icon_state = "Soldier"
Click()
usr << "Guard: <tt>You've finally arived, but our records don't show from where.</tt>"
switch(input("Where are you from?","Choose your race") in list("Imperial","Red Guard","Breton","Dark Elf","High Elf"))
if("Imperial")
usr << "An Imperial looks like this: \icon[/mob/player/Imperial]."
switch(input("Is this the Race you want?","Race Confirmation") in list("Yes","No"))
if("Yes")
usr.Race = "Imperial"
usr.icon_state = "Imperial"
if("No")
Click()
if("Red Guard")
usr << "A Red Guard looks like this: \icon[/mob/player/Red_Guard]."
switch(input("Is the the race you want?","Race Confirmation") in list("Yes","No"))
if("Yes")
usr.Race = "Red Guard"
usr.icon_state = "Red Guard"
if("No")
Click()


DO NOT COPY AND PASTE THIS! This is just an example. You click on the guy and he asks you where your from. You choose where and it'll change your icon and Race (class) accordingly. **DO NOT COPY PASTE! STUDY IT AND LEARN HOW IT WORKS!!!!** Obviously you're going to have to modify something like this according to your game.
In response to Pyro_dragons
Pyro_dragons wrote:
DO NOT COPY AND PASTE THIS! This is just an example. You click on the guy and he asks you where your from. You choose where and it'll change your icon and Race (class) accordingly. **DO NOT COPY PASTE! STUDY IT AND LEARN HOW IT WORKS!!!!** Obviously you're going to have to modify something like this according to your game.

This is code problems not be an asshole problems and how the hell can you stop him nor anyone from copy and pasteing it
In response to A.T.H.K
A.T.H.K wrote:
This is code problems not be an asshole problems

Then why the hell did you post?

He's just trying to help out, and he obviously doesn't want him copying, and pasting the code, because then he'll just end right back here asking why it doesn't work.
In response to Digital Samurai
He can't tell people what to do thats just pathectic theres more than one way to figure out how a peice of code works
In response to Pyro_dragons
You might want to put the recalling of Click in a spawn statement, otherwise someone can flood your game with runtime errors if they want to be a jerk. That is, continually calling it that way someone could overflow the stack.
In response to Digital Samurai
i dont copy and past, except from my own stuff and the easy stuff like say (i hate always coding say!!!)... and thanks pyro...ill see if i can make it work...
In response to Pyro_dragons
thanks alot...i see how it works, but can you possibly show me how yuo set up the class var...when i try to set it up i get undefined var as an error this is never fun...also if yuor going to tell someone learn how it works, uase "//" comments...it took me a while to figure out how to change it for how i want it to work...
In response to Dmingmage
okay i lied....i did copy and past garthor star mapper, but i am going to credit him....
Dmingmage wrote:
Code:
>

Problem description:

Okay, I'm trying to make a new character creation (maybe its been done i don't know, but i cant find a demo or a lib on in anywhere)i want to make it that instead of choosing your character class at initial LOG IN, you have to find the right guy to talk to... i can make it so your icon changes but the actual class does not!
...........................................................
classguy
icon = 'class.dmi'
verb
talk()
set src in view()
var
switch(class)
class = input("What Are You?") in list ("Pilot","Soldier")

if(class =="Pilot")
usr<<"Okay so your a pilot?"
/mob/PC/pilot
if(class == "Soldier")
usr<<"We have a mighty soldier!"
usr.icon = 'soldier.dmi'
usr.loc = locate(1,1,5)

...........................................................

The soldrier one only changes the icon, while the pilot one in theory should change the actual class... should i just change all vars through this as well as the icon?

mob
classguy
icon = 'class.dmi'
verb
talk()
set src in view()
var/mob/PC/New_Mob
switch(input("What Are You?") in list ("Pilot","Soldier"))
if("Pilot")
usr<<"Okay so your a pilot?"
New_Mob=new/mob/PC/Pilot
if("Soldier")
usr<<"We have a mighty soldier!"
New_Mob=new/mob/PC/Soldier
New_Mob.loc=locate(1,1,5)
usr.client.mob=New_Mob
del(usr)

In response to Teh Governator
that works it changesthe char.name too tho