Well, as work continues on my super cheezy Rockman EXE game, I came across another thing I don't know how to do...
What I want to be able to do is control 2 mobs and be able to switch between them at almost any time. Preferably I'd like them to be able stay where they are when you switch to the other... But, as you have probably guess I have NO IDEA how to do this...
I made up some cheezy code to just switch between them by relocating, changing icon, changing name, ect on one mob... and that doesnt even work...
I'm gonna throw my current code out there just so you can fix it if you can't help me get something better...
mob/PC/verb
Switch_to_Operator()
usr.x = usr.navix
usr.y = usr.naviy
usr.z = usr.naviz
usr.name = usr.operatorname
usr.innet=0
if(usr.operatorgender=="Male")
usr.icon = 'operator.dmi'
usr.icon_state = "male"
else
usr.icon = 'operator.dmi'
usr.icon_state = "female"
usr.verbs += /mob/PC/verb/Switch_to_Navi
usr.verbs -= /mob/PC/verb/Switch_to_Operator
usr.verbs -= /mob/PC/verb/PlugOut
usr.verbs -= /mob/PC/verb/Buster
usr.loc = locate(usr.opx,usr.opy,usr.opz)
Switch_to_Navi()
usr.x = usr.opx
usr.y = usr.opy
usr.z = usr.opz
usr.name = usr.naviname
usr.innet=1
usr.icon = 'navi.dmi'
usr.verbs -= /mob/PC/verb/Switch_to_Navi
usr.verbs += /mob/PC/verb/Switch_to_Operator
usr.verbs += /mob/PC/verb/PlugOut
usr.verbs += /mob/PC/verb/Buster
usr.loc = locate(usr.opx,usr.opy,usr.opz)
Yes that's n00bish crap, but what do you expect from me.
Can someone please either fix that code or help me code what I REALLY wanted to have in the game???
Thanks in advance.
ID:171997
Jul 11 2004, 2:23 pm
|
|
In response to DeathAwaitsU
|
|
Yay! It works. I had some pretty stupid mistakes in there.
Thanks |
In response to Newbreedofnerd
|
|
No problem, glad i could help.
Things only look stupid when you see the answer, so dont blame yourself. |
Or, alternatively...instead of having all of those redundant variables and if/else blocks, you can always use references.
client |
Here's my attempt:
Make sure that when you log in for your first ever time you're not going to be either an operater or a navigator. If you are then write in usr.navix/y/z and usr.opx/y/z and usr.operatorname and usr.naviname, so it doesn't locate you to a black screen and so you have a name.