I am working on a non-combat RPG-like game in which I hope to have a lot of character customization allowed as well as many quests.
I have the bases of the characters made as well as some clothes, but I am not sure how to set up the code for picking up, dropping, wearing, and taking off clothes which will appear on the character.
I know layers are involved, but my coding skills are novice at best.
Could someone please help me?
1
2
ID:159817
Jan 8 2009, 10:38 pm
|
|
In response to Gizhy
|
|
Thanks! That should work fine.
|
In response to SladeJT
|
|
No problem, glad to help xD
|
In response to Gizhy
|
|
Will this also work with hair? I mean, if I alter the code to allow choice of hairstyle or base appearance when people log-in.
|
In response to SladeJT
|
|
/*THIS IS THE HAIR OBJECTS*/ I made a login thingy to go with the hair to show you how to use it. |
In response to Gizhy
|
|
Cool! Thanks again. I knew that you could have classes (in the case of combative games) chosen through the following sort of thing:
mob/player Login() world << " \red [usr] logs on!" alert("Welcome to the demo. This is a test to see if the game works fairly well. Any suggestions to improve it are welcome. Any reports of bugs or glitches are requested. Thanks for your time.","Welcome","Ok") src.name = input("What is your name?","Name",src.key) var/a = input("What do you want to be?")in list("Swordsman","Cleric") if(a=="Swordsman") usr.icon = 'Player.dmi' usr.icon_state = "Fighter" usr.Class = "Swordsman" |
In response to SladeJT
|
|
You should use the:
switch(input("What class")in list("Warrior","Mage")) I find that easier to use then: var/a = input("What do you want to be?")in list("Swordsman","Cleric") |
In response to Gizhy
|
|
Switch seems to imply just two choices. What if there's more than two?
|
In response to SladeJT
|
|
here is an example:
switch(input("You can have as many options as you desire")in list("1","2","3","4","5","6","7","8","9","10")) You can have as many inputs as you want xD |
In response to Gizhy
|
|
Ahh... Cool! That'll save length!
|
In response to SladeJT
|
|
Glad I could help, if you need anything else contact me on my MSN: [email protected]
|
In response to Gizhy
|
|
Thank you very much.
|
In response to SladeJT
|
|
No problem.
|
In response to Gizhy
|
|
Er, I have hit a little obstacle.
switch(input("Do you want shorts?")in list("Yes","No")). if("Yes") switch(input("What color?")in list("Red","Green","Yellow","Black","White","Blue")). if("Red") usr.overlays += /obj/Red_Shorts/ src.Move(usr) += /obj/Red_Shorts/ in usr The last line is apparently incorrect. How do I make the clothes item appear in the inventory through the Login? |
In response to SladeJT
|
|
At the Login() put:
mob |
In response to Gizhy
|
|
Ah. Thanks.
|
In response to SladeJT
|
|
no prob.
|
In response to Gizhy
|
|
That's not really good.
You should define the verbs under something like /obj/equippable instead of just obj/Shirt. That helps with repeated code issue. Another thing I noticed was: src.loc = locate(usr.x,usr.y,usr.z) Why not just equal it to usr.loc ? Or better yet, Move() it to usr.loc. |
In response to SladeJT
|
|
It's also more efficient than multiple if()s.
|
1
2
Hope this helps you out. =D