ID:165435
 
Im designing a text based game, and I have done all my own coding so far, but i am looking to have a function similar to byondarena's which is to have the attack/skill/etc in the stat tab. I have tried a few times, but I cant get it. Can someone help me at all? Thanks.
Sure this is fairly easy all you have to do is create an object and but it in the statpanel.

Like so:
obj/Attack
icon = 'blah.dmi' // if you want an icon for it
Click()
// Your attack and turn stuff here (assuming your game is turned based attacking)
var/obj/ATK = new /obj/Attack

mob/Stat()
statpanel("Commands")
stat(ATK)


Try not to copy and paste.
In response to A.T.H.K
A.T.H.K wrote:
Sure this is fairly easy all you have to do is create an object and but it in the statpanel.

Like so:
> obj/Attack
> icon = 'blah.dmi' // if you want an icon for it
> Click()
> // Your attack and turn stuff here (assuming your game is turned based attacking)
> var/obj/ATK = new /obj/Attack
>
> mob/Stat()
> statpanel("Commands")
> stat(ATK)
>

Try not to copy and paste.

I think, but if it's turn based I think you would want it like this:

mob/Stat()
statpanel("Commands")
if(usr.turn)
stat(ATK)
In response to Masuko Shintaro
Yes but thats easy and un nesassary to post.

And don't use usr in procs..
In response to A.T.H.K
A.T.H.K wrote:
And don't use usr in procs..

usr is valid in stat. It defaults to the person looking at the stat panel.
Though you generally want to use either src or usr. Probably src if you're using client.statobj.
By the way, the stat() proc has usr as it's default recipient which is unchangeable. Are you going to complain about that? =)
In response to Android Data
No not really SRC FTW!! :P