For my game, I have three statpanels that are always visible to eveyone. I have things like HP in there, The problem is; It dosen't seem to like me putting in variables.
mob/Stat()
statpanel ("player1")
stat ("health points", *Variable here*)
Thats what I was thinking, perhaps I'm going about it wrong?
EDIT:Nevermind that, im just stupid apparently. I just need to define the var ahead of time. that should be easy enough to find in the guide. Now to make an edit verb...
ID:167414
Mar 16 2006, 9:36 pm (Edited on Mar 16 2006, 9:50 pm)
|
|
In response to A.T.H.K
|
|
I've gotten that part working. Just now I got an error saying "Expected expression" where my variable is declared. Even though a few mins ago I had it compiling.
I'm currently looking through the guide to try to get it working with limited luck. Their example goes: var/weather = "looks like a nice day" while my code is car/1hp = 0 Also I'm not sure what you mean by DM tags. I thought I did and trid it, didnt work. |
In response to Inutaisho
|
|
Inutaisho wrote:
while my code is car/1hp = 0 Couple of problems with that: Firstly, it's "var", not "car". =) And secondly, variable names must start with a letter. They can't start with digits. |
In response to Crispy
|
|
er, its typed properly in my code. I'm just typing to quickly here. And yea it was the 1.
Now it thinks that my edit verb is a proc... *goes to read up on procs* |
In response to Inutaisho
|
|
Verbs and procs are almost the same thing in DM, except for the obvious difference that players can use verbs directly. What's the error message you're getting?
|
In response to Crispy
|
|
mob
verb set cagegory="GM" edit_hp(t as num) t = hp Invalid proc definition is the error. I rewrote the code and I get no errors when I remove the set category line but, it still dosen't work right. |
In response to Inutaisho
|
|
There is no such thing at cagegory, should be category.
Also, to change hp, you need to change the HP to t, not t to HP. Thus, usr.hp=t |
In response to Mysame
|
|
Thanks, corrected spelling. Though I still get the error.
dm:52:error:set :invalid proc definition dm:53:error::invalid proc definition If I remove the set then it works how I want it to. Ill probably set it up ad a verb only viewable by me in this case. Thanks for the help. EDIT: I gotta stop programming after midnight. Everything works. A few more hours of work and game finished yeey! |
In response to Inutaisho
|
|
dm:52:error:set :invalid proc definition That's because you need to 'set category' IN the verb, thus in mob/verb/give_hp() , not in mob/verb. EDIT: I gotta stop programming after midnight. Everything works. A few more hours of work and game finished yeey! Don't. Never release first games. Many people say this, few people know this. Don't. |
In response to Mysame
|
|
Mysame wrote:
Don't. Never release first games. Many people say this, few people know this. Don't. why? I have been working on mine for months, just working on the engine for it(and its still only about 90% complete,then making the actuale game for it). why wouldn't you publish your first game. and does this include non-BYOND games? like my 1 written in BASIC? |
In response to Albire
|
|
Working for months and you couldn't fix that problem? :/
|
In response to Albire
|
|
First games are typically worse than games created later on - some people become ashamed of their first efforts once they've made a few more games, and wish they'd never released it.
But that's not always true, and hey, it's your "Net Dream", so I say go right ahead. It'll be a learning experience if nothing else. I released my first completed game and I don't regret it. |
In response to Mysame
|
|
This one isnt designed to be used by public. Its gonna be used by me and three others over byond.
So you will probably see it pop up once in awhile but, you wont be able to connect. |
In response to Mysame
|
|
Mysame wrote:
Working for months and you couldn't fix that problem? :/ no, im not the one who was having this issue lol. i was just reading what you said and it struck my curiosity lol |
In response to Inutaisho
|
|
Ok the code for a stat panel should look like this....
var health = 25 maxhealth = 25 mob/stat() stat("Health","[health]/[maxhealth]" |
In response to Crispy
|
|
I did, and I do regret it. <_<
I've still got a CD with the source code for it on it. I should microwave that CD... |
In response to Bamrulez
|
|
Bamrulez wrote:
Ok the code for a stat panel should look like this.... Please use DM tags.. and your still wrong :P you forgot the ) at the end and the capitial S for stat() |
In response to A.T.H.K
|
|
A.T.H.K wrote:
Please use DM tags.. and your still wrong :P you forgot the ) at the end and the capitial S for stat() And the health and maxhealth vars should belong to mobs, or everyone in the game will end up sharing the same health value! (Which is a very bad thing...) mob/var |
In response to Crispy
|
|
Oops i missed that good on ya :)
|
Please post your code in the DM tags