ID:174116
 
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
I think I Know How To DO the top one, but not sure:
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()
if(src.level == 10)
src<<"You Learned Kick!"
src.verb += verb/spells/Kick
else
..()
Dtroys wrote:

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
..()

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:
> 
> 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()
> if(src.level == 10)
> src<<"You Learned Kick!"
> src.verb += verb/spells/Kick


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!"
src.verb += verb/spells/Kick


what about


if(src.level += 10)
src<<"You Learned Kick!"
src.verb += verb/spells/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)
src<<"You Learned Kick!"
src.verb += verb/spells/Kick


You could use <FONT color=Blue>var</font>iables to put in reguired level gaining, or something..... Maybe like this:
mob/var
levelsreq = 10
levelreglvl = 0


then where the "if(src.level == 10)"
you could do:
src.levelsreg -= 1
if(src.levelsreg == 0)
src.levelsreg = 10
if(src.levelreglvl == 0)
src<<"You Learned Kick!"
src.verb += verb/spells/Kick
if(src.levelreglvl == 1)
src<<"You Learned Punch!"
src.verb += verb/spells/Punch
if(src.levelreglvl == 2)
src<<"You Learned Combo!"
src.verb += verb/spells/Combo
src.levelreglvl += 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)
view(6) <<"Prepare for Destruction ,[usr] Explods in to bits and peaces"
usr.overlays += /obj/smokeball
for(mob/M in oview(6))
M.inselfdexplosion = 1//I put this in to make sure that only poeple who have the overlay lose it later
M.overlays += /obj/smokeball
M.powerlevel = 0
M:Die()
usr.powerlevel = 0
usr.Die()
usr.overlays -= /obj/smokeball
for(mob/M in oview(6))
if(M.inselfdexplosion = 1)
M.inselfdexplosion =0
M.overlays -= /obj/smokeball
world<<"[usr] yells Self Destruct To All The Inocent Bystanders!HAAAAAAAAAAA!!!!!"//Sorry, I don't think that'd anymore because theres more that one person so I took [M] out
else
usr.powerlevel = 0
usr.Die()
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)
if(src == usr) statpanel("Moves",src.moves)

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

for eg:

obj
it
verb
Instant_Transmission

i have alot of items and technique, if you know any thing that make only items comes in Inventory..


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