Well, I've just got started creating my RPG. (I had a thread concerning my Level Up system but I thought I should start a fresh one as these are new questions. This is my first RPG ive created, and I'm new to byond code. I've read some tutorials, but I find it much easier using the forums.
Anyway, I have a few questions, and I'd appreciate any answers you can give. I'll add to the questions as I progress. Thanks!
1. How can I stop players from being able to move whilst they are next to an enemy mob? (So they are 'engaged' in battle'. I intend to add an escape command later)
2. How can I create a tab on the command menu so that I can display the stats of the character? I think I can do this, but I don't know how to create a tab.
3. How can I stop numbers (such as HP) from exceeding their maximum? I have a MaxHP value, but I have no coe to say that the HP cannot exceed this value.
I'll show you my code if you need to see it.
Thanks!
ID:166170
Sep 11 2006, 2:10 pm
|
|
1)
mob/Move(na, direction) 2) mob/Stat() 3) var |
In response to DivineO'peanut
|
|
mob Right. The statpanel works perfectly, thanks. I'm having a little trouble with the other two though. Firstly, under mob/verb/cure I cannot seem to get the code you gave me to work. What have I done wrong? Secondly, the other code. I tred entering the code you showed me, but it said 'inconsistent indentation' no matter how I tried to put it in. Where exactly should this go? Thanks for your help. |
In response to RoadToDawn
|
|
Remember, codes are there to show you an example of HOW it works.. NOT to be copied/pasted (saying tis because of the indentation error)
1) What you have done wrong about the min()/max() example is that you placed it first, before the HP was added.. what is the point of checking if the HP went over before you add something to the HP which can make it go over? (Though you could've simply edited the example Div showed you and added the HP+5 within it, saving you a byte or two) 2) Read what I said at the beginning - GhostAnime |
In response to RoadToDawn
|
|
i think that means your deathcheck dont work
do you habe it on the end of your attack phase? |
In response to GhostAnime
|
|
Right, I've got it all working, except for the code to stop players moving when they encounter (stand next to) an enemy.
Where/how exactly do I put that code inot my game? Thanks |
This is my code. I have a problem - I can attack and kill an enemy, and everything seems to run smoothly, but I recieve the following error:
runtime error: Cannot read null.HP
proc name: attack (/mob/verb/attack)
usr: RoadToDawn (/mob)
src: RoadToDawn (/mob)
call stack:
RoadToDawn (/mob): attack(null)
As far as I can tell the only actual problem is the fact that this error is appearing. As far as I can tell its working. Any clues as to why this keeps popping up each time an enemy dies?