ID:263076
 
Code:
mob/var/flight = 0

mob/learn
verb/Flight()
set category = "skills"

if(src.dead == 1)
src << "You can't Fly while your dead"
return

if(src.fly == 1)
src << "You land on the ground from the sky"
src.fly = 0
src.density = 1
src.doing = 0
src.icon_state = ""
return
else
if(src.doing == 1)
return
else
src.icon_state = "flight"
src << "You lift off the ground and take for the sky"
src.fly = 1
src.density = 0
src.doing = 1
return

if(src.flight_lock == 1)
src << "You cannot Fly at the moment"
return



Problem description: When i compile, i get:
loading Charmed-War of the Witches.dme
Bukujutsu.dm:7:error:src.dead: undefined var
Bukujutsu.dm:11:error:src.fly: undefined var
Bukujutsu.dm:13:error:src.fly: undefined var
Bukujutsu.dm:15:error:src.doing: undefined var
Bukujutsu.dm:19:error:src.doing: undefined var
Bukujutsu.dm:24:error:src.fly: undefined var
Bukujutsu.dm:26:error:src.doing: undefined var
Bukujutsu.dm:28:error:src.flight_lock: undefined var
Charmed-War of the Witches.dmb - 10 errors, 0 warnings (double-click on an error to jump to it)

It's a twist on the Bukujutsu from the Dragonball Eluysium 2 game. Why wont it work?


Frankly it's not working because your ripped code is using vars you never defined. You really need to abandon that code and write your own, if nothing else because the original is so shoddy. Friends don't let friends write rips.

A few things that code is doing that it shouldn't:

1) It's using src.var all over the place, which is totally unnecessay unless you're using a local var (belonging just to that proc or verb) with the same name.

2) It's using if(var==1) and if(var==0) to test true/false values. For values that can only be true or false, if(var) and if(!var) are not only shorter, but safer.

3) It's giving pointless error messages like the fact that dead mobs can't fly. That's obvious. Spamming the player won't help anything.

4) It's got the else statement after an if() block that ends with return. If you're bailing out of the code in the first part, you don't need to use else for the second part.

5) There's no punctuation whatsoever on any of the text messages. The word "fly" is being capitalized for no reason whatsoever. And it's "you're", not "your".

And most embarrassingly,
6) You're doing the flight_lock check at the very end of the verb, well after flight has already been achieved if it was possible. Instead that needs to be done prior to takeoff.

For future reference, please also post your code inside the <dm> tags, not before them.

Lummox JR
In response to Lummox JR
You can lock this now iv'e found a better code that works! ;)
In response to Master Scar
omg not another dbz game :(
In response to Z-warrior-Z
Z-warrior-Z wrote:
omg not another dbz game :(

Could be a dragon game.. i have some icon tiles from a diff game maker that has dragon on ground then dragon in air tiles.. But if it is another dbz game, then darn >.<
In response to Grimson10
No its a charmed game ;)
In response to Master Scar
... With Dragonball Zeta's sourcecode?
In response to Mysame
Nope, i just needed flight from it
In response to Master Scar
So you're ripping a charmed game and adding Zeta code to it? o.o; you're like... The evil ripping god of doom X_X



lol...

"U TEH GAEIN SSJ3285325 KUZ URX DA CHARMID 1!11"
In response to DivineO'peanut
Im not ripping im using a starter code and adding onto it so dont accuse me of ripping
In response to Master Scar
Master Scar wrote:
Im not ripping im using a starter code and adding onto it so dont accuse me of ripping

Ehm, you would be accused of ripping even if it was MyFirstWorld's source code. >_>
In response to DivineO'peanut
It's the Charmed starter code that is for people how want to make charmed games. it needs alot done to it though
In response to Master Scar
And using that isn't ripping? That 'library' or however you want to call it is bogus anyhow.
In response to Mysame
I dont no im new at this as iv'e said many times
In response to Master Scar
Well, if you're new and you want to start out something of your own and something hopefully more original, this'll help you.

ZBT's Tutorial - Basics of a BYOND RPG.
DreamMaker Guide. - Everything is in here. Everything. *
DreamMaker Reference (F1 in DreamMaker brings this up (and is probably more updated)) - Looking up what procs do, mean, ...

*: Things like 'zomg gm howz?','u wan fly code lol' are not described. These are achieved by having some coding knowledge and some thinking on how to achieve what you're trying to do.