Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
engine_obj.h
1/* Renegade Scripts.dll
2 Copyright 2013 Tiberian Technologies
3
4 This file is part of the Renegade scripts.dll
5 The Renegade scripts.dll is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 2, or (at your option) any later
8 version. See the file COPYING for more details.
9 In addition, an exemption is given to allow Run Time Dynamic Linking of this code with any closed source module that does not contain code covered by this licence.
10 Only the source code to the module(s) containing the licenced code has to be released.
11*/
12#ifndef SCRIPTS_INCLUDE__ENGINE_OBJ_H
13#define SCRIPTS_INCLUDE__ENGINE_OBJ_H
14#include "scripts.h"
15#include "engine_vector.h"
16#include "Matrix3D.h"
17
18//type/class ID values for various things
19#define CID_Beacon 0x3016
20#define CID_Building 0xD001 //only covers generic buildings,not the special stuff like PowerPlant or Refinery
21#define CID_C4 0x3006
22#define CID_ConstructionYard 0xD00A
23#define CID_PowerPlant 0xD003
24#define CID_PowerUp 0x3003
25#define CID_Refinery 0xD002
26#define CID_RepairBay 0xD009
27#define CID_SamSite 0x3007
28#define CID_ScriptZone 0x300E
29#define CID_Simple 0x3004
30#define CID_Soldier 0x3001
31#define CID_SoldierFactory 0xD004
32#define CID_SpecialEffects 0x3013
33#define CID_Vehicle 0x3010
34#define CID_VehicleFactory 0xD005 //for WarFactory or Airstrip,use the relavent values
35#define CID_WarFactory 0xD007
36#define CID_Airstrip 0xD006
37#define CID_Cinematic 0x3011
38#define CID_ComCenter 0xD008
39#define CID_Weapon 0xB001
40#define CID_Ammo 0xB002
41#define CID_Explosion 0xB003
42#define CID_Spawner 0x300D
43
44int SCRIPTS_API Get_Object_Type(GameObject *obj); //get the team of an object,0 = Nod,1 = GDI,2 = neutral,works on buildings
45void SCRIPTS_API Set_Object_Type(GameObject *obj,int type); //set the team of an object,0 = Nod,1 = GDI,2 = neutral,works on buildings
46void SCRIPTS_API Get_Object_Color(GameObject *obj, unsigned int *red, unsigned int *green, unsigned int *blue); //get color for a player
47GameObject SCRIPTS_API *Find_Smart_Object_By_Team(int Team); //will find the first SmartGameObj (i.e. soldier or vechicle) for the team,0 = Nod,1 = GDI
48GameObject SCRIPTS_API *Find_Object_By_Team(int Team); //will find the first object for the team,0 = Nod,1 = GDI
49GameObject SCRIPTS_API *Find_Non_Player_Object_By_Team(int Team); //will find the first non player object for the team,0 = Nod,1 = GDI
50GameObject SCRIPTS_API *Find_Object_By_Preset(int Team,const char *Preset_Name); //will find the first object of team matching preset,0 = Nod,1 = GDI,2 = either
51GameObject SCRIPTS_API *Find_Closest_Non_Building_Object_By_Team(int Team,Vector3 position); //find the closest non building object to position
52GameObject SCRIPTS_API *Find_Closest_Preset_By_Team(int Team,const Vector3 &pos,const char *Preset); //Find the closest object of this preset to this position
53GameObject SCRIPTS_API *Find_Random_Preset_By_Team(int Team,const char *Preset); //Find a random object on this team with this preset
54int SCRIPTS_API Get_Object_Count(int Team,const char *Preset); //Get the number of objects that exist with this preset
55SimpleDynVecClass<GameObject*> SCRIPTS_API *Get_All_Objects_By_Preset(int Team,const char *Preset); //Returns an array of all objects of this preset
56GameObject SCRIPTS_API *Find_Nearest_Preset(Vector3 position, const char* preset); //find the nearest preset
57GameObject SCRIPTS_API *Find_Random_Preset(const char* preset, int min, int max); //find a random preset
58void SCRIPTS_API Send_Custom_To_Team_Buildings(int Team,GameObject *sender,int type,int param,float delay); //send custom to team buildings
59void SCRIPTS_API Send_Custom_To_Team_Preset(int Team,const char *PresetName,GameObject *sender,int type,int param,float delay); //send custom to team preset
60void SCRIPTS_API Send_Custom_All_Objects_Area(int type,const Vector3 &Position,float Distance,GameObject *sender,int team); //sends a custom to all objects in a given area
61void SCRIPTS_API Send_Custom_All_Objects(int type,GameObject *sender,int team); //sends a custom to all objects
62void SCRIPTS_API Send_Custom_Event_To_Object(GameObject *sender,const char *Preset,int type,int param,float delay); //this is like Send_Custom_Event except it sends to all objects of the passed in preset
63bool SCRIPTS_API Is_Unit_In_Range(const char *preset,float range,Vector3 location,int team,bool empty); //Is the given unit type in range of a location
64bool SCRIPTS_API Get_Is_Powerup_Persistant(GameObject *obj); //Returns if this powerup is persistant
65bool SCRIPTS_API Get_Powerup_Always_Allow_Grant(GameObject *obj); //Returns if this powerup is set to always allows grant
66void SCRIPTS_API Set_Powerup_Always_Allow_Grant(GameObject *obj,bool Grant); //Change if this powerup is set to always allows grant
67int SCRIPTS_API Get_Powerup_Grant_Sound(GameObject *obj); //Returns the sound that is played when this powerup is picked up
68void SCRIPTS_API Grant_Powerup(GameObject *obj,const char *Preset_Name); //grants a powerup
69GameObject SCRIPTS_API *Find_Closest_Building(const Vector3& position); // Find the closest building
70Vector3 SCRIPTS_API Get_Velocity( GameObject* obj ); // Get the current velocity of a PhysicalGameObject
71void SCRIPTS_API Set_Velocity( GameObject* obj, Vector3 velocity ); // Set the velocity of a PhysicalGameObject
72Matrix3D SCRIPTS_API Get_Transform( GameObject* obj ); // Get the current transform of a PhysicalGameObject
73void SCRIPTS_API Set_Transform( GameObject* obj, Matrix3D transform ); // Set the transform of a PhysicalGameObject
74GameObject SCRIPTS_API * Get_Closest_Armed_Object_To_Object( GameObject* obj, int team = 2 ); // Get the closest armed (vehicle or infantry) object to the given object, optionally filtered by team (0=Nod,1=GDI,2=any)
75
76SCRIPTS_API bool Verify_Preset_Limit(int team, int instance_count, uint32* preset_ids, int preset_id_count, GameObject* ignore = nullptr); // returns true if limit is reached
77#endif