ZScript actor functions

From ZDoom Wiki
Jump to: navigation, search
Note: This feature is for ZScript only.


ZScript adds a plethora of functions used internally by actors, exposing them all to it. There is no guarantee these will work in DECORATE, especially anything that is not type int, double, bool or void.

Functions

  • double absangle(double ang1, double ang2);
  • Vector2 AngleToVector(double angle, double length = 1);
  • double BobSin(double fb);
  • double deltaangle(double ang1, double ang2);
  • Vector2 RotateVector(Vector2 vec, double angle);
  • static int GetSpriteIndex(name sprt);
  • static double GetDefaultSpeed(class<Actor> type);
  • static class<Actor> GetSpawnableType(int spawnnum);
  • void RemoveFromHash();
  • void ChangeTid(int newtid);
  • static int FindUniqueTid(int start = 0, int limit = 0);
  • void SetShade(color col);
  • string GetTag(string defstr = "");
  • void SetTag(string defstr = "");
  • double GetBobOffset(double frac = 0);
  • void ClearCounters();
  • bool GiveBody (int num, int max=0);
  • bool HitFloor();
  • bool isTeammate(Actor other);
  • int PlayerNumber();
  • void SetFriendPlayer(PlayerInfo player);
  • void SoundAlert(Actor target, bool splash = false, double maxdist = 0);
  • void DaggerAlert(Actor target);
  • void ClearBounce();
  • TerrainDef GetFloorTerrain();
  • bool CheckLocalView(int consoleplayer);
  • void ExplodeMissile(line lin = null, Actor target = null);
  • void RestoreDamage();
  • int SpawnHealth();
  • void SetDamage(int dmg);
  • double Distance2D(Actor other);
  • double Distance3D(Actor other);
  • void SetOrigin(vector3 newpos, bool moving);
  • void SetXYZ(vector3 newpos);
  • Actor GetPointer(int aaptr);
  • double BulletSlope(out FTranslatedLineTarget pLineTarget = null, int aimflags = 0);
  • Actor AimTarget();
  • bool CheckMissileSpawn(double maxdist);
  • bool CheckPosition(Vector2 pos, bool actorsonly = false);
  • bool TestMobjLocation();
  • static Actor Spawn(class<Actor> type, vector3 pos = (0,0,0), int replace = NO_REPLACE);
  • Actor SpawnMissile(Actor dest, class<Actor> type, Actor owner = null);
  • Actor SpawnMissileXYZ(Vector3 pos, Actor dest, Class<Actor> type, bool checkspawn = true, Actor owner = null);
  • Actor SpawnMissileZ (double z, Actor dest, class<Actor> type);
  • Actor SpawnMissileAngleZSpeed (double z, class<Actor> type, double angle, double vz, double speed, Actor owner = null, bool checkspawn = true);
  • Actor SpawnMissileZAimed (double z, Actor dest, Class<Actor> type);
  • Actor SpawnSubMissile(Class<Actor> type, Actor target);
  • Actor, Actor SpawnPlayerMissile(class<Actor> type, double angle = 0, double x = 0, double y = 0, double z = 0, out FTranslatedLineTarget pLineTarget = null, bool nofreeaim = false, *bool noautoaim = false, int aimflags = 0);
  • void SpawnTeleportFog(Vector3 pos, bool beforeTele, bool setTarget);
  • Actor RoughMonsterSearch(int distance, bool onlyseekable = false, bool frontonly = false);
  • int ApplyDamageFactor(Name damagetype, int damage);
  • int GetModifiedDamage(Name damagetype, int damage, bool passive);
  • bool CheckBossDeath();
  • Actor OldSpawnMissile(Actor dest, class<Actor> type, Actor owner = null);
  • Actor SpawnPuff(class<Actor> pufftype, vector3 pos, double hitdir, double particledir, int updown, int flags = 0, Actor victim = null);
  • void SpawnBlood (Vector3 pos1, double dir, int damage);
  • void BloodSplatter (Vector3 pos, double hitangle, bool axe = false);
  • bool HitWater (sector sec, Vector3 pos, bool checkabove = false, bool alert = true, bool force = false);
  • void PlaySpawnSound(Actor missile);
  • bool CountsAsKill();
  • bool Teleport(Vector3 pos, double angle, int flags);
  • void TraceBleed(int damage, Actor missile);
  • void TraceBleedAngle(int damage, double angle, double pitch);
  • void SetIdle(bool nofunction = false);
  • bool CheckMeleeRange();
  • bool CheckMeleeRange2();
  • int DamageMobj(Actor inflictor, Actor source, int damage, Name mod, int flags = 0, double angle = 0);
  • void PoisonMobj (Actor inflictor, Actor source, int damage, int duration, int period, Name type);
  • double AimLineAttack(double angle, double distance, out FTranslatedLineTarget pLineTarget = null, double vrange = 0., int flags = 0, Actor target = null, Actor friender = null);
  • Actor, int LineAttack(double angle, double distance, double pitch, int damage, Name damageType, class<Actor> pufftype, int flags = 0, out FTranslatedLineTarget victim = null);
  • bool CheckSight(Actor target, int flags = 0);
  • bool IsVisible(Actor other, bool allaround, LookExParams params = null);
  • bool HitFriend();
  • bool MonsterMove();
  • void FindFloorCeiling(int flags = 0);
  • double, double GetFriction();
  • bool, Actor TestMobjZ(bool quick = false);
  • bool InStateSequence(State newstate, State basestate);
  • bool TryWalk();
  • bool TryMove(vector2 newpos, int dropoff);
  • void NewChaseDir();
  • void RandomChaseDir();
  • bool CheckMissileRange();
  • bool SetState(state st, bool nofunction = false);
  • state FindState(statelabel st, bool exact = false);
  • bool SetStateLabel(statelabel st, bool nofunction = false) { return SetState(FindState(st), nofunction); }
  • action state ResolveState(statelabel st); // this one, unlike FindState, is context aware.
  • void LinkToWorld();
  • void UnlinkFromWorld();
  • bool CanSeek(Actor target);
  • double AngleTo(Actor target, bool absolute = false);
  • void AddZ(double zadd, bool moving = true);
  • void SetZ(double z);
  • vector2 Vec2To(Actor other);
  • vector3 Vec3To(Actor other);
  • vector3 Vec3Offset(double x, double y, double z, bool absolute = false);
  • vector3 Vec3Angle(double length, double angle, double z = 0, bool absolute = false);
  • vector2 Vec2Angle(double length, double angle, bool absolute = false);
  • vector2 Vec2Offset(double x, double y, bool absolute = false);
  • vector3 Vec2OffsetZ(double x, double y, double atz, bool absolute = false);
  • void VelFromAngle(double speed = 0, double angle = 0);
  • void Vel3DFromAngle(double speed, double angle, double pitch);
  • void Thrust(double speed = 0, double angle = 0);
  • bool isFriend(Actor other);
  • bool isHostile(Actor other);
  • void AdjustFloorClip();
  • DropItem GetDropItems();
  • void CopyFriendliness (Actor other, bool changeTarget, bool resetHealth = true);
  • bool LookForMonsters();
  • bool LookForTid(bool allaround, LookExParams params = null);
  • bool LookForEnemies(bool allaround, LookExParams params = null);
  • bool LookForPlayers(bool allaround, LookExParams params = null);
  • bool TeleportMove(Vector3 pos, bool telefrag, bool modifyactor = true);
  • double DistanceBySpeed(Actor other, double speed);
  • name GetSpecies();
  • void PlayActiveSound();
  • void Howl();
  • void DrawSplash (int count, double angle, int kind);
  • void GiveSecret(bool printmsg = true, bool playsound = true);
  • double GetCameraHeight();
  • double GetGravity();
  • bool CheckClass(class<Actor> checkclass, int ptr_select = AAPTR_DEFAULT, bool match_superclass = false);
  • string GetClassName();
  • void AddInventory(Inventory inv);
  • void RemoveInventory(Inventory inv);
  • void ClearInventory();
  • Inventory FindInventory(class<Inventory> itemtype, bool subclass = false);
  • Inventory GiveInventoryType(class<Inventory> itemtype);
  • Inventory DropInventory (Inventory item);
  • bool UseInventory(Inventory item);
  • bool GiveAmmo (Class<Ammo> type, int amount);
  • float AccuracyFactor();
  • Actor SpawnMissileAngle (class<Actor> type, double angle, double vz)
  • Actor SpawnMissileAngleZ (double z, class<Actor> type, double angle, double vz)
  • void A_ChangeLinkFlags(int blockmap = FLAG_NO_CHANGE, int sector = FLAG_NO_CHANGE)
  • void SpawnDirt (double radius)
  • bool SinkMobj (double speed)
  • bool RaiseMobj (double speed)
  • void A_Face(Actor faceto, double max_turn = 0, double max_pitch = 270, double ang_offset = 0, double pitch_offset = 0, int flags = 0, double z_ofs = 0);

See also