ID:161542
 
Ok, all my skills are objs and my battle system are mob procs, and everytime I try and attack, it says read the objs...help??
Lundex wrote:
everytime I try and attack, it says read the objs

...What?
Anyway, if you need to access an object, you need a reference to it. Your mobs probably already have references to their skills.
In response to Kaioken
skills
parent_type =/obj
var
min
max
attacks
punch
name = "Punch"
min = 1
max = 100



Ok, I want min/max*100 and use that in a mob...
In response to Lundex
/mob/var/obj/skills/attacks/spattack
/mob/Login()
if(alert(src, "What will your special attack be?", "Choose Attack", "Punch", "Kick")=="Punch")
src.spattack=new/obj/skills/attacks/punch
else
src.spattack=new/obj/skills/attacks/kick
/mob/verb/attack(M as mob in oview(1))
M.health-=spattack.min/spattack.max*100 //A bit useless if you're going to divide then multiply by 100

Something like that?
In response to Lundex
If this is all you're using those /objs for, then you don't need them at all in the first place. And I doubt you require min and max vars like that in any case. Use the numbers directly as you probably don't need them dynamic.

Ok, I want min/max*100 and use that in a mob...

You don't seem to have fully understood what I said in the other topic. Where's the sense in doing 1/100*100?
If the maximum value is 100, then you've already got the variable itself as the percent... you don't need to do anything more, since it is already X out of 100, hence, a percent.

Also either way, you're going to want to have a mob character know it's skills. You'd do these by adding variables on the mob for that (or one /list variable).

Lastly, on the forums, put your code between <DM> and </DM> tags.
In response to Kaioken
Ok, my bad I'm having an off day. Ok, my final problem... my percent is based off your current number (example 1) and your max which is 100. Now everytime I put that in my mob proc it says it can't read my current number. I tried making a var that is a mob and make my current number equal to my var. And it didn't work...
In response to Kaioken
    punch(mob/M,var/skills/attacks/A)
var/percent = (A.min/100)
Everytime I use it, it says I can't modify min..