PDA

View Full Version : No access to NPC step, homing, or Dir. via script?



Gleeok
11-01-2007, 09:43 AM
===================================
--- NPC Functions and Variables ---
===================================

int X
* The NPC's current X coordinate, in pixels.

int Y
* The NPC's current Y coordinate, in pixels.

int Dir
* The direction the NPC is facing. Use the DIR_ constants in std.zh to
* set and compare this value.

int Rate
* The NPC's movement rate. For a point of reference, the Octorok on Crack
* has a rate of 16.

int ASpeed
* The speed of the NPC's animation, in screen frames.

int Haltrate
* The extent to which the NPC stands still while moving around the
* screen. As a point of reference, the Zols and Gels have haltrate of
* 16.

int DrawStyle
* The way the NPC is animated. Use the DS_ constants in std.zh to set or
* compare this value.

int HP
* The NPC's current hitpoints. Each swing of the wooden sword removes 2
* hitpoints.

int Damage
* The amount of damage dealt to a naked Link when he touches this NPC, in
* quarter-hearts.

int WeaponDamage
* The amount of damage dealt to a naked Link by this NPC's weapon, in
* quarter-hearts.

int Tile
* The number of the starting tile used by this NPC.

int Weapon
* The weapon used by this enemy. Use the WPN_ constants in std.zh to set
* or compare this value. Note that it typically only makes sense to
* assign weapons labelled as enemy weapons (WPN_ENEMY) (with the
* exception of WPN_NONE) to this value.

int ItemSet
* The items that the NPC might drop when killed. Use the IS_ constants
* in std.zh to set or compare this value.

int CSet
* The CSet used by this NPC.

int BossPal
* The boss pallete used by this NPC; this pallete is only used if CSet
* is 14 (the reserved boss cset). Use the BPAL_ constants in std.zh to
* set or compare this value.

int SFX
* The sound effects emitted by the enemy. Use the SFX_ constants in
* std.zh to set or compare this value.

int Extend
* I have actually no idea. I would have thought the NPC's link tile
* modifier, but that makes no sense ;)


Am I missing something, or are these planned for post 2.5?

..and does anyone know what extend does?


*edit* by dir. I mean direction..

DarkDragon
11-01-2007, 10:10 AM
You mean NPC->Dir and NPC->Rate?
I think homing was added long after NPCs were added to ZScript.
Note, too, that changing enemy properties is extremely buggy, because a lot of the enemy code is not designed to handle properties changing in mid-motion. For 2.50 I'll probably have to declare that writing to any of these is undefined.

The_Amaster
11-01-2007, 10:12 AM
int Damage
* The amount of damage dealt to a naked Link when he touches this NPC, in
* quarter-hearts.

int WeaponDamage
* The amount of damage dealt to a naked Link by this NPC's weapon, in
* quarter-hearts.

Ummmm, if NPC's can do this, than what seperates them from custom enemies? I mean, they drop items, they deal damage, etc. etc.

ShadowMancer
11-01-2007, 12:04 PM
..and does anyone know what extend does?
Well, I assume it does the same thing as Link->Extend (Big Link!)
but big enemies are not implimented as of yet..


Ummmm, if NPC's can do this, than what seperates them from custom enemies? I mean, they drop items, they deal damage, etc. etc.
What do you mean by this? The NPC type in ZScript controls enemies. It also controls the actual NPC's (old man etc) although I don't think most of the NPC properites actually apply to them, so NPC is read as Enemy.

Gleeok
11-02-2007, 01:11 AM
int Dir
* The direction the NPC is facing. Use the DIR_ constants in std.zh to
* set and compare this value.

Wow...apparently i'm half-blind or something. I really don't know how I missed that one...:odd:




You mean NPC->Dir and NPC->Rate?
I think homing was added long after NPCs were added to ZScript.
Note, too, that changing enemy properties is extremely buggy, because a lot of the enemy code is not designed to handle properties changing in mid-motion. For 2.50 I'll probably have to declare that writing to any of these is undefined.

You can't mean all of them!? X,Y, ->HP, all seem to work perfectly. Zodiac has these running practically every screen.

I can understand some of them being buggy as all hell though, so I see your point. Maybe ones like Damage, WeaponDamage, Halt, Dir may work also. Perhaps you'll let some scripters test these out before making a final verdict?
*hint*