ID:262266
 
Code:
obj
yakon1
verb
Transform()
set category = "Fighting"
set name = "Transform/Revert"
if(usr.race == "Yakoon"||usr.race == "yakon")
switch(input("Which form do you wish to Transform/Revert?","Transform",text) in list("Yakon Form 2 (Max)","Revert","Cancel"))
if("Yakon Form 2 (Max)")
if(usr.state == "Normal")
if(usr.maxpowerlevel >= 2500000)
view(6) << "<font color = Yellow>-[usr.name]<font color = white> begins to transform!-"
usr.maxpowerlevel*=3
usr.MaxKi*=3
usr.def*=3
usr.str*=3
usr.overlays+='elec purple.dmi'
usr.state = "Yakon Form 2 (Max)"
else
usr << "<i>You still are too weak...."
else
usr << "<b>You must Revert frist."

if("Revert")
if(usr.state == "Normal")
usr << "You are reverted already."
else
view(6) << "<font color = Yellow>-[usr.name]<font color = white> begins to revert from [usr.state]-"
usr.icon = 'Yakon.dmi'
usr.underlays -= new /obj/aura_upper/
usr.underlays-='ssj aura Ultra SSJ Aura.dmi'
usr.overlays-='elec purple.dmi'
usr.overlays-='elec purple.dmi'
usr.overlays-='elec purple.dmi'
if(usr.state == "Yakon Form 2 (Max)")
usr.maxpowerlevel/=3
usr.MaxKi/=3
usr.def/=3
usr.str/=3
usr.underlays -= new /obj/aura_upper/
usr.underlays-='ssj aura Ultra SSJ Aura.dmi'
usr.overlays-='elec purple.dmi'
usr.overlays-='elec purple.dmi'
usr.overlays-='elec purple.dmi'
usr.state = "Normal"
if(usr.powerlevel >= usr.maxpowerlevel)
usr.powerlevel = usr.maxpowerlevel


Problem description:

The Problem is as soon as i go Yakon form 2 and i log out in that form and wh i log in back i can go to yakon form 2 again.
I want to so when i log out in form 2 i can log in again i have to revert to go to form 2 again. Do you understand ?
So many if, if, if, if, ifs...

I might suggest making a mob variable that remembers what form you were in last(like when you transform, do...

Form = FORMNAME
)

then on login make the verb that makes you tranform but put the variable where the formname would have been...

understand??

(I did this with my music files, worked like a charm :D)
Are you saying when you log out, you revert? (Is that what you want?)
In response to Lejendary Artz
Lejendary Artz wrote:
Are you saying when you log out, you revert?

I dont think so. I think what his problem is, is that when he transforms into form 2 and relogs, it doesnt register that he is still form 2. So he is able to transfrom from form 2 into form 2 without reverting to form 1.

I think.

If that didn't make sense then I'll try and explain with a picture or something, just let me know if your still confused, or if I am just totally wrong. (hey its happend before)
This is a dumb question; do you have savefiles for your game?

-Ryan
In response to Madcrackfiend
ya that it it's very confusing sorry to hurt youtr head fingure out what the hell i'm saying.
Ya when you log out in form 2 and log in again you'll be in form 2 so for so good and only probelm is you can go to form 2 again but i'm am in form 2.
I hope you understand can you help me now?
In response to Sayian Hunter
and yes i do have a save file
OKay, Im still trying to figgure ot and answer ot your problem, but in the mean time do you mind If I ask you a few questions about your design philosophy?

1. Why do you have a check for the usr.race of both yakon and yakoon? I dont quite understand that part.

2. Although you are reverting, isn't reverting techically just a type of transformation? Do you really need to call the verb transform/revert?

3. Just astectics here but wouldn't it look a little better if instead of "You must Revert frist." you had "You are already transformed." And instead of "You are reverted already." you had "You cannot revert any farther." But you could also have it that way for a reason.

4. For some reason it looks like everything below if("Revert") is both inefficently coded and a little redundant. I mean you check usr.state for normal, and do the stuff there, but in the if statement below that you remove several under/overlays as well as output text to view(6). You then preform an if on usr.state again for yakon2 and remove the same under/overlays that are already removed because if usr.state is = to yakon 2 then by default it is not = to normal.

5. When you use stuf like <.b.> to change the text output its important to use <./.b.> to shut it back off or you will incounter problems later with your text output. (without the periods ofcourse. Those are just there for the forum.)

And finally could you please show us your save/load code so we can see if part of the problem is located there?

Stupid question time, but whats a yakon? I used to watch dbz and I think its the big green guy of bibidi's that goku kills by forcefeeding it energy, but its been 3 years or more now. Am I right? (remember when vegeta beat pwii-pwii down with one hand and never even broke a sweat? Vegeta is so cool ^.^ Thats right I like dbz... Actually I just like veg, he's so cocky and arrogant plus he can back it up, its just great.)
In response to Madcrackfiend
ok

1. I have yakkon becasue both yakon and yakoon has the same transformation.

2. amm well ya so the player know what you can revert or transform with this verb.

3. And i do have it that way for a reason.

4. So what to do there.

5. o sorry i change it thx.

An here is the code for the savefile

Write(savefile/F)
..()

F["last_x"] << x
F["last_y"] << y
F["last_z"] << z
F["powerlevel"] >> powerlevel
F["maxpowerlevel"] >> maxpowerlevel
F["Ki"] >> Ki
F["MaxKi"] >> MaxKi
F["def"] >> def
F["str"] >> str
F["Legendary"] >> Legendary

Read(savefile/F)
..()
var/last_x
var/last_y
var/last_z
F["powerlevel"] >> powerlevel
F["maxpowerlevel"] >> maxpowerlevel
F["Ki"] >> Ki
F["MaxKi"] >> MaxKi
F["def"] >> def
F["str"] >> str
F["Legendary"] >> Legendary
F["last_x"] >> last_x
F["last_y"] >> last_y
F["last_z"] >> last_z
loc = locate(last_x, last_y, last_z)
if(usr.Fusion == 1)
alert("This character is a fused character, therefore cannot be used... please load up your original character before he was fused.")
del(src)

LOL wurd i'm a big dbz fan, and ya that big green guy is yakon. lol i like goku and vegeta and gohan and all the saiyan hey all look hot. ^_^
In response to Sayian Hunter
You are fricken joking me. 1337 Dawg

--Ryan
In response to Sayian Hunter
I thought that was yakon.

What I ment by question one was not why you have a check for Yakoon and yakon, but why you would even have two different types of yakon? Especially one capatolized and the other not. It just seems a little confusing to me, but then again I am easily confused.


This is how I would fix the redundancies under the revert if check.

Please note however that this advice is made without full knowledge of all possible usr.state configs available.

                        if("Revert")
if(usr.state == "Normal")
usr << "You are reverted already."
if(usr.state == "Yakon Form 2 (Max)")
view(6) << "<font color = Yellow>-[usr.name]<font color = white> begins to revert from [usr.state]-"
usr.maxpowerlevel/=3
usr.MaxKi/=3
usr.def/=3
usr.str/=3
usr.underlays -= new /obj/aura_upper/
usr.underlays-='ssj aura Ultra SSJ Aura.dmi'
usr.overlays-='elec purple.dmi'
usr.state = "Normal"
if(usr.powerlevel >= usr.maxpowerlevel)
usr.powerlevel = usr.maxpowerlevel


Im still not quite sure how to fix the original problem yet, but I am working on finding an answer for you. You never know, maybe someone else will swoop in and fix it before I can.

Hope this helps you some.

P.S. In the future please dont make topics with no topic, it is kinda hard to sort out which is the right one. for example there are at least 4 no topic posts all in close proxemity to each other at the time of my writing this. I had to look at them all to find the right one.
In response to Madcrackfiend
lol thanks anyway
In response to Sayian Hunter
Sayian Hunter wrote:
    Write(savefile/F)
> ..()
>
> F["last_x"] << x
> F["last_y"] << y
> F["last_z"] << z
> F["powerlevel"] >> powerlevel
> F["maxpowerlevel"] >> maxpowerlevel
> F["Ki"] >> Ki
> F["MaxKi"] >> MaxKi
> F["def"] >> def
> F["str"] >> str
> F["Legendary"] >> Legendary
>
> Read(savefile/F)
> ..()
> var/last_x
> var/last_y
> var/last_z
> F["powerlevel"] >> powerlevel
> F["maxpowerlevel"] >> maxpowerlevel
> F["Ki"] >> Ki
> F["MaxKi"] >> MaxKi
> F["def"] >> def
> F["str"] >> str
> F["Legendary"] >> Legendary
> F["last_x"] >> last_x
> F["last_y"] >> last_y
> F["last_z"] >> last_z
> loc = locate(last_x, last_y, last_z)
> if(usr.Fusion == 1)
> alert("This character is a fused character, therefore cannot be used... please load up your original character before he was fused.")
> del(src)
>


this is how it should look:

    Write(savefile/F)
..()

F["last_x"] << x
F["last_y"] << y
F["last_z"] << z
F["powerlevel"] << powerlevel
F["maxpowerlevel"] << maxpowerlevel
F["Ki"] << Ki
F["MaxKi"] << MaxKi
F["def"] << def
F["str"] << str
F["Legendary"] << Legendary
F["State"] << state //added this.

Read(savefile/F)
..()
var/last_x
var/last_y
var/last_z
F["powerlevel"] >> powerlevel
F["maxpowerlevel"] >> maxpowerlevel
F["Ki"] >> Ki
F["MaxKi"] >> MaxKi
F["def"] >> def
F["str"] >> str
F["Legendary"] >> Legendary
F["State"] >> state //added this too.
F["last_x"] >> last_x
F["last_y"] >> last_y
F["last_z"] >> last_z
loc = locate(last_x, last_y, last_z)
if(usr.Fusion == 1)
alert("This character is a fused character, therefore cannot be used... please load up your original character before he was fused.")
del(src)


Pardon me if I am wrong, but that's how it should be, I think.