ID:1662931
 
Keywords: coding, newbie
(See the best response by GhostAnime.)
Hi I just started to learn how to code this week and I'm reading guides and all and trying out stuff but I haven't found is...where is all these verbs like
turf
hurtplayer
turf
killplayer

these examples of "killplayer ect.." do we have to code that or is it already in the byond system?
I'm sorry if I'm being totally naive/ignorant but I'm still learning, if they are already implemented can you show me where? Thanks alot!
Best response
What do you mean by turf in those examples?

You will have to make your own procedure for hurting/killing players. I recommend going modular - splitting each portion up.

(ex: a proc for taking away a stat, which calls a Death_Proc/On_Kill() type of proc being when the HP <= 0 and, if wanted at some point, Aftermath/After_Death() type of procedure after the person is killed - being called on the On_Kill proc).



For example, when making an attacking verb, you will call:

Take HP
--> Takes away HP
--> Check if HP <= 0. If so, call On_Kill()

On_Kill
--> Verify HP <= 0, otherwise stop
--> Do killing stuff (ex: transport, EXP gain, etc.)
--> (Optional) Have another procedure to deal with what happens if something dies, ex: Killed().

Killed()
--> (Optional) Redefine for every unique thing you want for it (ex: a dying speech, differing from each Enemy)

A skeleton example of the above

Ghost thanks! But that also means we have to code in HP? So byond knows what we're talking about?
In response to HELENO
HELENO wrote:
Ghost thanks! But that also means we have to code in HP? So byond knows what we're talking about?

Yes, you have to program EVERYTHING (well, other than the built-in stuff :P).

I recommend reading through the DM Guide, doing the examples shown in there, and reading tutorials

When making a major game, try splitting it up in to smaller parts and work on it like it was an individual project.