Im making a game and am having some trouble. My game isnt a DBZ game. It may use DBZ icons, but its definitely not a DBZ game. Oh fine it is a DBZ game. Anyway... I had just figured out how to make leveling up work. Im trying to make my bugs, now saibamen, move around. I cant get them to do that. Now after fiddling with the code, when i log in i get a black screen. I was also trying to, when i level up, change to a, yes DBZ again, ssj form. I cant figure out how to do either of these things. Please, if you are gonna help would u please tell me where in my code whatever you tell me to do should go. Here is my code:
//This is a test world started by Tabu34 on 3/15/04 and yet to be completed...
mob
var/level=1
var/exp=0 // experience (total)
var/expNeeded= 15 // experience for the next level
var/maxHP= 20
var/expgained= 3
proc
Look() //name of the proc
var/mob/M //makes the variable M which has to be mob/usr
while(src) //while src is still alive
if(M in oview(5)) //looks for a mob/usr in oview(5)
walk_to(src,M,1,4) //src walks to M until it is within 1 block away, moving 4/10th of a second
if(M in oview(1)) //checks if M is in oview(1), if true it continues
step_towards(src,M) //src step towards M which cause the bump()
else //if M isnt in oview(1)
step_rand(src) //steps randomly on the field
break //breaks out of while loop
else //if M isnt in oview(5)
for(M in view(src)) //for every M that is in view of src
break //breaks out of while loop
sleep(5) //sleeps half a sec before re-doing loop
spawn(2) //waits 2/10 a second before continue to do Look() again
Look() //redoes loop
PDeathCheck()
if (UHP <=0)
world << "Tabu34 dies!"
world << "Tabu34 was killed by [src]"
src.loc = locate(1,1,1)//restarts
src.UHP = src.maxUHP//resets health
InjuredCheck()
if (HP <=15)
icon = 'bugcut.dmi'
else
icon = 'bug.dmi'
LevelUp()
if(src.exp >= src.expNeeded)
src <<"Welcome,[src], to level [level]!"
src.level++
src.maxUHP += 4
src.UHP = src.maxUHP
src.expNeeded *= 2
src.exp = 0
DeathCheck(mob/M as mob) //checks to see if an attack is deadly
if(HP <= 0) //if the defender's HP is low enough...
world << "[src] dies!" //do the death messaging
world << "[src] was killed by [M]!"
world << "[M] gains [expgained] experience!"
M.exp+= 3 //adds exp points
M.LevelUp()
del(src)
mob
icon = 'person.dmi' //makes it so all mobs will be created with the person icon
name = "player"
var
HP = 30 //declares a new variable called HP, with a value of 30
wealth = 0 //total money
UHP = 40 //new var Hp for user
maxHp = 30 //max hp for bug
maxUHP = 40 //max hp for user
strength = 3//change to the amount you want the player to have
defense = 2//same here
number = 1
Del()
var/obj/gold/G = new(loc) //create a new obj from the gold blueprint
G.amount = rand(1,100) //set its amount variable randomly
..() //call the parent
Login()
loc = locate(/turf/start)
world << "[usr] had logged into Testworld!"
bug
icon = 'bug.dmi'
name = "bug"
strength = 5
defense = 3
var/mob/bug/
New()
. = ..()
spawn(bug)
Look()
Bump(mob/M)
if(istype(M,/mob/))
attackb(M)
proc/attackb(mob/U)
var/damage = rand(1,strength)
UHP -= damage
U <<"You are being attacked by [src.name]!"
src.exp += rand(1,5)
src.LevelUp()
PDeathCheck()
verb
attack(mob/G as mob in oview(1)) //attack a mob within 1 tile of you
usr << "You attack [G]!" //send this message to the usr
oview() << "[usr] attacks [G]!" //send this message to everybody else
var/damage = rand(1,10) //assign a random # to a new variable
usr << "[damage] damage!" //tell the damage to the world
G.HP -= damage //take away the damage from M
G.InjuredCheck() //check for injuries w/ proc
G.DeathCheck(src) //check for death with a proc
say(msg as text) //What the usr says is passed into "msg" as text
world << "[usr]: [msg]" //The world sees chatroom-like output
obj
gold //define a "gold" prototype, which is a kind of obj
icon = 'gold.dmi' //set the default icon
var
amount //declare a new variable called "amount"
verb
get() //obj/gold/verb/get()
set src in view(1) //src must be close
usr << "You pick up [amount] gold."
usr.wealth += amount //add to usr.wealth
del(src) //delete the gold
obj
tree
icon = 'tree.dmi'
density = 1
turf
grass //defines a "grass" prototype, which is a kind of turf...
icon = 'grass.dmi' //and has an icon named 'grass.dmi'. In single quotes!
start
icon = 'start.dmi'
world //we set one of our world's characteristics:
turf = /turf/grass //its default turf is the grass turf.
mob/Stat() //Call the Stat proc that updates the stat window every Tenth of a second...
stat("[src]'s Stats:",src.desc) //Place in the stat panel, the word Stats:, and the srcs description.
stat(" HP: ","[UHP]/[maxUHP]" ) //It makes it easier to read if you put a bunch of spaces like that.
stat(" Gold: ","[wealth]")
stat(" Experience: ","[exp]/[expNeeded]")
stat(" Level: ","[level]")
stat(" Strength: ","[strength]")
stat(" Defense: ","[defense]")
//END OF CODE
PLEASE HELP!!!
I'm Begging Here!!
ID:147559
![]() Mar 30 2004, 12:29 pm
|
|
![]() Mar 30 2004, 1:54 pm
|
|
That tutorial is bad. Use the newer version.
|
Garthor wrote:
That tutorial is bad. Use the newer version. alright, where would i find this newer version that you soeak of? And is it made bu Zilal like the other 1? |
You can find the newer version of the tutorial you're apparently using to write your AI proc on BYONDscape.com.
|
Alright... A link would be nice. I cant seem to find it. Or Even the NAME of the Tutorial!
At least were getting somewhere! |
I Still Cant get My enemies to move, but also... When My Character Levels up, I want him/her to go through a transformation, but i dont know how to do that... Please Help.
Here Is My Code: //This is a test world started by Tabu34 on 3/15/04 and yet to be completed... mob var/level=1 var/exp=0 // experience (total) var/expNeeded= 15 // experience for the next level var/maxHP= 20 var/expgained= 3 var/Spawned_By proc Look() //name of the proc var/mob/M //makes the variable M which has to be mob/usr while(src) //while src is still alive if(M in oview(5)) //looks for a mob/usr in oview(5) walk_to(src,M,1,4) //src walks to M until it is within 1 block away, moving 4/10th of a second if(M in oview(1)) //checks if M is in oview(1), if true it continues step_towards(src,M) //src step towards M which cause the bump() else //if M isnt in oview(1) step_rand(src) //steps randomly on the field break //breaks out of while loop else //if M isnt in oview(5) for(M in view(src)) //for every M that is in view of src break //breaks out of while loop sleep(5) //sleeps half a sec before re-doing loop spawn(2) //waits 2/10 a second before continue to do Look() again Look() //redoes loop PDeathCheck() if (UHP <=0) world << "Tabu34 dies!" world << "Tabu34 was killed by [src]" src.loc = locate(1,1,1)//restarts src.UHP = src.maxUHP//resets health InjuredCheck() if (HP <=15) icon = 'bugcut.dmi' else icon = 'bug.dmi' LevelUp(mob/M) if(src.exp >= src.expNeeded) src <<"You Leveled Up!!" src.level++ src.maxUHP+=rand(1,4) src.UHP=src.maxUHP src.expNeeded *= 2 src.exp = 0 if(src.level==2) src.icon='ssj.dmi' DeathCheck(mob/M as mob) //checks to see if an attack is deadly if(HP <= 0) //if the defender's HP is low enough... world << "[src] dies!" //do the death messaging world << "[src] was killed by [M]!" world << "[M] gains [expgained] experience!" M.exp+= 3 //adds exp points M.LevelUp() del(src) mob icon = 'person.dmi' //makes it so all mobs will be created with the person icon var HP = 30 //declares a new variable called HP, with a value of 30 wealth = 0 //total money UHP = 40 //new var Hp for user maxHp = 30 //max hp for bug maxUHP = 40 //max hp for user strength = 3//change to the amount you want the player to have defense = 2//same here number = 1 Del() var/obj/gold/G = new(loc) //create a new obj from the gold blueprint G.amount = rand(1,100) //set its amount variable randomly ..() //call the parent Login() loc = locate(/turf/start) world << "[usr] had logged into Testworld!" bug icon = 'bug.dmi' name = "bug" strength = 5 defense = 3 var/mob/bug/ Bump(mob/M) if(istype(M,/mob/)) attackb(M) proc/attackb(mob/U) var/damage = rand(1,strength) UHP -= damage U <<"You are being attacked by [src.name]!" src.exp += rand(1,5) src.LevelUp() PDeathCheck() verb attack(mob/G as mob in oview(1)) //attack a mob within 1 tile of you usr << "You attack [G]!" //send this message to the usr oview() << "[usr] attacks [G]!" //send this message to everybody else var/damage = rand(1,10) //assign a random # to a new variable usr << "[damage] damage!" //tell the damage to the world G.HP -= damage //take away the damage from M G.InjuredCheck() //check for injuries w/ proc G.DeathCheck(src) //check for death with a proc say(msg as text) //What the usr says is passed into "msg" as text world << "[usr]: [msg]" //The world sees chatroom-like output obj gold //define a "gold" prototype, which is a kind of obj icon = 'gold.dmi' //set the default icon var amount //declare a new variable called "amount" verb get() //obj/gold/verb/get() set src in view(1) //src must be close usr << "You pick up [amount] gold." usr.wealth += amount //add to usr.wealth del(src) //delete the gold tree icon = 'tree.dmi' density = 1 bug //You can't see spawn points on the map because they have no image. The game maker can when making a map though :P var/My_Spawned //This is a var that means "The mob that this spawnpoint spawned." New() spawn() SpawnCycle() proc/SpawnCycle() if(My_Spawned == null) //If this is not defined... sleep(100) var/E = new /mob/bug (src.loc) //Make a new stickman as a variable, so we can edit the newly created stickman after this is defined. My_Spawned = E //This links M to the spawn point. E:Spawned_By = src //This is so when a mob dies, the Death() proc can easily find the spawn point that spawned it, and set that spawn point's My_Spawned var to null. spawn(10) SpawnCycle() turf grass //defines a "grass" prototype, which is a kind of turf... icon = 'grass.dmi' //and has an icon named 'grass.dmi'. In single quotes! start icon = 'start.dmi' world //we set one of our world's characteristics: turf = /turf/grass //its default turf is the grass turf. mob/Stat() //Call the Stat proc that updates the stat window every Tenth of a second... stat("[src]'s Stats:",src.desc) //Place in the stat panel, the word Stats:, and the srcs description. stat(" HP: ","[UHP]/[maxUHP]" ) //It makes it easier to read if you put a bunch of spaces like that. stat(" Gold: ","[wealth]") stat(" Experience: ","[exp]/[expNeeded]") stat(" Level: ","[level]") stat(" Strength: ","[strength]") stat(" Defense: ","[defense]") //END OF CODE |