Common Scripting Misconceptions
From SphereWiki
Revision as of 11:48, 4 June 2009 by MrSugarCube (talk | contribs) (Created page with ''''''(WIP)''''' ==CHARDEF blocks must use a number== This is simply not true, and certainly not recommended. I highly recommend that scripters use a DEFNAME instead of a new num...')
(WIP)
CHARDEF blocks must use a number
This is simply not true, and certainly not recommended. I highly recommend that scripters use a DEFNAME instead of a new number. For example, instead of this:
[CHARDEF 04000] DEFNAME=c_scary_man ID=c_man ...
You can just as easily do this:
[CHARDEF c_scary_man] ID=c_man // 0190 would work here just as easily, since c_man = 0190 ...
So, you see, you can simply including a DEFNAME in the definition for the creature. SPHERE will assign it some sort of internal number. You don't want to worry about that sort of thing. If you REALLY want to see what the number is, you can always use the following function:
[FUNCTION examine_id] // Usage: examine_id <id_to_examine> // Example: examine_id c_man SYSMESSAGE <EVAL <ARGS>>
But then again, why would you want to? The entire idea behind the DEFNAME feature is that there is no need for you to memorize those scary numbers. Remember Chapter 1? :)