hi
i have a leveling up system
i want to know how to code if some on ereach certain amount of level they gets some new technique
mob
proc
Levelup()
if(src.exp>=src.Max_exp)
src.level += 1
src.exp = 0
src.Max_exp *= 2
src << "You gained a level!"
src.Statup()
else
..()
mob
proc
Statup()
src.strength += 1
src.Max_HP += 20
src.HP = src.Max_HP
src << "Your stats increase!"
this is my level up system
and i want to learn how to give people technique every 10 levels
for example
Level 10 = punch
Level 20 = kick
Level 30 = BLAH
...
///
......
..
so on!
i want to know how to code for that please
ok i want to know how to apear this on my hub please
Join [-= Version Blah =- ~Main Server~ {Host: Blah} (Players Online: Blah)]
please explain to me where to put and wat the code does so...net time if a newbei ask me i know how to explain to them.
thanks alot friends
- Dtroys
ID:174116
Sep 29 2003, 12:29 am
|
|
Sep 29 2003, 2:14 am
|
|
I think I Know How To DO the top one, but not sure:
|
Dtroys wrote:
mob Just a big of friendly advice: "..()" means "call the parent type's proc by the same name". You would use ..() in things like Login() if you wanted it to perform the default mob-placement and setting client.statobj, or you would use it in an attack proc where mob/pc and mob/monster has basically the same attack format with a few quirks added for each one and you wanted to have the parent proc handle the similarities. Putting ..() in your levelup proc would make it try to call a atom/movable/proc/levelup. (mobs are derived from atom movable) If you just don't like seeing your proceedures trail off into nothing, then you could add a return at the end. Although you are not required to return byond procedures since they do it by default, it is still a good programming habit to do so. Also, if you don't know much about return and learn about it before you need it, you will be saved a hastle later on trying to understand what it does. (Return is one of those things that many people often don't fully grasp untill they've banged their head on the table enough times to jostle the brain cells into place that that the knowledge randomly forms therein.) Hope that was enlightening. -Loduwijk |
In response to DarkCampainger
|
|
DarkCampainger wrote:
I think I Know How To DO the top one, but not sure: > Thats how it would work, and as for the other question look up world.status |
In response to Loduwijk
|
|
ty friend.i learned something at the end from u...thanks alot
-dtroys |
In response to Wanabe
|
|
that means i have to put if(blah.blah == 20) every time i insert a technique?
ok..i understand the process if(src.level == 10) src<<"You Learned Kick!" what about if(src.level += 10) src<<"You Learned Kick!"src<<"You Learned Punch!" src.verb += verb/spells/Punch |
In response to Dtroys
|
|
I don't think that would work, but if you really don't want to write:
if(usr.level == 10) You could use <FONT color=Blue>var</font>iables to put in reguired level gaining, or something..... Maybe like this: mob/var then where the "if(src.level == 10)" you could do: src.levelsreg -= 1 That would do it... but it looks like it's the same amount of work.... you might as well type it up maually... It's not as bad as you think, I've seen alot worse... I <FONT color=Red>hate</font> repetitive things... <FONT color=Green> Sincerly, DarkCampainger </font> |
In response to DarkCampainger
|
|
this is my self destruction technique code. I want it work as when i press the verb i explode and kill people view(6) soround me
but for some reason when i click it it ask which mob i want to explode with and kills them first and kills me after 10 second could some one help me with this please obj selfdestruct verb SelfDestruct(mob/M as mob in view(6)) set name = "Self-Destruct" set category = "Techniques" if(usr.kame == 1) usr << "You are currently using a blast" if(usr.kame == 0) world <<"[usr]'s power up sky rocket..starts to release it" if(M.maxpowerlevel < usr.maxpowerlevel) view(6) <<"Prepare for Destruction [usr] Explods in to bits and peaces" usr.overlays += /obj/smokeball M.overlays += /obj/smokeball M.powerlevel = 0 usr.powerlevel = 0 M:Die() usr.Die() usr.overlays -= /obj/smokeball M.overlays -= /obj/smokeball world<<"[usr] yells to [M]:Self Destruct HAAAAAAAAAAA!!!!!" else usr.powerlevel = 0 usr.Die() |
In response to Dtroys
|
|
I think You need to use:
for(var/mob/M in oview(6)) |
In response to DarkCampainger
|
|
So i just need to replace my old one with this one?
for(var/mob/M in oview(6)) |
In response to Dtroys
|
|
yeah, somthing like this:
if(M.maxpowerlevel < usr.maxpowerlevel) |
In response to DarkCampainger
|
|
Inventory Problem!!!!!!!
obj/item bootglove name = "White Boots and Gloves" icon = 'gloves-boots.dmi' worn = 0 verb Wear() set category = "Inventory" if(src.worn == 1) src.worn = 0 usr.overlays -= 'gloves-boots.dmi' usr << "You remove the [src.name]." else src.worn = 1 usr.overlays += 'gloves-boots.dmi' usr << "You wear the [src.name]." Drop() set category = "Inventory" if(src.worn == 1) usr << "Not while its being worn." if(src.worn == 0) src.loc=locate(usr.x,usr.y+1,usr.z) Get() set category = "Inventory" set src in oview(1) Move(usr) thats my item code....i would like to make seperate inventory panel for my items i tried to make one but in my invetory panel there is techniques i think it belong to contents..so cud you show me how to get rid of my technique from my inventory panel and i want to have only items in it my inventory code was mob Stat() statpanel("Inventory Stat(Contents) but i see my moves and items in there. I only want items in it! -dtroys thank you in advance |
In response to Dtroys
|
|
This is what I have:
if(src == usr) statpanel("Inventory",src.contents) |
In response to DarkCampainger
|
|
ok mate i tried its but its tsill dont show up on seperate panel..
i want it like .. all my item come in one inventory panel.... when i add ur method it makes all my technique + items in it..! is there any way i can make a code that allow only item on my panel ty - dtroys |
In response to Dtroys
|
|
You need to make a seperate list for your "Moves", like var/list/moves and add them here.
|
In response to FranquiBoy
|
|
wait, what are the moves then? objects? or when they get them does it make them in usr?
if You make A list like he said the stat code would be this: if(src == usr) statpanel("Inventory",src.contents) Then, just incase You don't know how to do lists it would look like this: mob/var/moves=list("") and Then When they learn a new move add this:
usr.moves+=list("Punch")
|
In response to DarkCampainger
|
|
the thing is my technique in obj var
for eg: obj it verb Instant_Transmission thats how it comes also my items code is: obj/item red_scouter icon = 'red-scouter.dmi' layer = MOB_LAYER + 5 name = "Class II Scouter" i have alot of items and technique, if you know any thing that make only items comes in Inventory.. i dont want my tech in it but.. it still comes under it! ty Dtroys |
In response to Dtroys
|
|
should be
Instant_Transmission() verbs are a type of proc, and need the () at the end. You should find out more about arguements, also, if you already don't know about the () <-Airjoe-> |
In response to Dtroys
|
|
Dtroys wrote:
the thing is my technique in obj var their showing up in your inventory because their objects, I suggest making them verb/Instant_Transmission() or maybe verb/moves/Instant_Transmission() if you want to keep better track of them.... |
In response to Airjoe
|
|
thanks for all who helped me out
i learned how to level up i learned how to put items and make var i found information on newbei forum about hub information thanks again you all are great |