diff -uwr source/scripts/Defines.h sourceold/scripts/Defines.h --- source/scripts/Defines.h 2014-02-09 10:10:15.913734400 +1000 +++ sourceold/scripts/Defines.h 2014-02-03 06:32:47.687312500 +1000 @@ -68,16 +68,9 @@ // unreachable code # ifdef DEBUG -# define TT_ASSUME_UNREACHABLE TT_INTERRUPT +# define TT_UNREACHABLE TT_INTERRUPT # else -# define TT_ASSUME_UNREACHABLE __assume(false); -# endif - -// unreachable code -# ifdef DEBUG -# define TT_ASSERT_UNREACHABLE TT_INTERRUPT -# else -# define TT_ASSERT_UNREACHABLE +# define TT_UNREACHABLE __assume(false); # endif #define TT_UNIMPLEMENTED TT_INTERRUPT diff -uwr source/scripts/dp88_ar.cpp sourceold/scripts/dp88_ar.cpp --- source/scripts/dp88_ar.cpp 2014-02-08 06:34:48.004882800 +1000 +++ sourceold/scripts/dp88_ar.cpp 2014-02-03 06:32:47.690242100 +1000 @@ -3214,7 +3214,7 @@ void dp88_AR_Prism_Tower::Timer_Expired ( GameObject *obj, int number ) { // Piggy back our assistance polling and charge refilling on the existing think timer - if ( number == TIMER_AI_THINK ) + if ( number == TIMER_CUSTOMAI_THINK ) { /* Send out assistance requests to ensure other towers don't time out on the 'last seen' check * diff -uwr source/scripts/dp88_customAI.cpp sourceold/scripts/dp88_customAI.cpp --- source/scripts/dp88_customAI.cpp 2014-02-08 06:34:48.008789000 +1000 +++ sourceold/scripts/dp88_customAI.cpp 2014-02-05 12:53:03.875000000 +1000 @@ -306,7 +306,7 @@ m_pCurrentObjective = NULL; // Start timer which runs for the lifetime of this object - this belongs in Init - Commands->Start_Timer ( obj, this, 1.0, TIMER_AI_THINK ); + Commands->Start_Timer ( obj, this, 1.0, TIMER_CUSTOMAI_THINK ); } // ------------------------------------------------------------------------------------------------- @@ -364,7 +364,7 @@ void dp88_AI_Tank_Offensive::Timer_Expired( GameObject *obj, int number ) { // Check target is still alive, still an enemy (eg: stolen vehicles) and in range - if ( number == TIMER_AI_THINK ) + if ( number == TIMER_CUSTOMAI_THINK ) { if ( targetID != 0 ) { @@ -416,7 +416,7 @@ } // Timer always runs - Commands->Start_Timer ( obj, this, 1.0, TIMER_AI_THINK ); + Commands->Start_Timer ( obj, this, 1.0, TIMER_CUSTOMAI_THINK ); } } @@ -536,7 +536,7 @@ dp88_customAI::Init( obj ); // Start timer which runs for the lifetime of this object - Commands->Start_Timer ( obj, this, 1.0, TIMER_AI_THINK ); + Commands->Start_Timer ( obj, this, 1.0, TIMER_CUSTOMAI_THINK ); } // ------------------------------------------------------------------------------------------------- @@ -620,7 +620,7 @@ void dp88_AI_Turret::Timer_Expired( GameObject *obj, int number ) { // Check target is still alive, still an enemy (eg: stolen vehicles) and in range - if ( number == TIMER_AI_THINK ) + if ( number == TIMER_CUSTOMAI_THINK ) { if ( targetID != 0 ) { @@ -646,7 +646,7 @@ } // Timer always runs - Commands->Start_Timer ( obj, this, 1.0, TIMER_AI_THINK ); + Commands->Start_Timer ( obj, this, 1.0, TIMER_CUSTOMAI_THINK ); } } @@ -811,7 +811,7 @@ void dp88_AI_PopupTurret::Timer_Expired ( GameObject* pSelf, int number ) { // Piggy-back the undeploy timer logic on the existing target check timer since its always running - if ( number == TIMER_AI_THINK && m_deploymentState == STATE_DEPLOYED ) + if ( number == TIMER_CUSTOMAI_THINK && m_deploymentState == STATE_DEPLOYED ) { // If we have no target and have reached the undeploy timeout then trigger undeployment if ( targetID == 0 && time(NULL) > m_undeployTime ) @@ -1001,7 +1001,7 @@ { // Use the existing custom AI think timer to check for a base power state changes and, if it has // changed, update the idle animation (and abort any charge up in progress) - if ( number == TIMER_AI_THINK && m_bPowerState != checkPowerState(pSelf) ) + if ( number == TIMER_CUSTOMAI_THINK && m_bPowerState != checkPowerState(pSelf) ) { m_bPowerState = !m_bPowerState; @@ -1024,7 +1024,7 @@ // We might as well piggy back the discharged checks on the same timer too whilst we are at it... - if ( number == TIMER_AI_THINK && m_bIsDischarging ) + if ( number == TIMER_CUSTOMAI_THINK && m_bIsDischarging ) { // Have we unloaded our entire clip? If so then we can start charging for the next attack if ( Get_Current_Bullets(pSelf) == 0 ) diff -uwr source/scripts/dp88_custom_timer_defines.h sourceold/scripts/dp88_custom_timer_defines.h --- source/scripts/dp88_custom_timer_defines.h 2014-02-08 06:34:48.011718700 +1000 +++ sourceold/scripts/dp88_custom_timer_defines.h 2014-02-03 06:32:47.693171800 +1000 @@ -45,14 +45,13 @@ #define CUSTOM_UNITSOUNDS_HEALDECREMENT (DP88_CUSTOM|MISC|0x02) //!< Used by dp88_unitSounds to track the amount of healing a unit has recieved over a time period #define CUSTOM_ROCKETEER_VEHICLEKILLED (DP88_CUSTOM|MISC|0x03) //!< Used by dp88_AR_Rocketeer to notify itself when the flight vehicle dies (via JFW_Death_Send_Custom) -#define TIMER_RANDOMWEATHER (DP88_TIMER|MISC|0x01) //!< Used by dp88_randomWeather to do a weather update +#define TIMER_RANDOMWEATHER (DP88_TIMER|MISC|0x01) //!< Timer to do a weather update #define TIMER_SPAWNVEHICLEPART (DP88_TIMER|MISC|0x02) //!< Used by dp88_spawnVehiclePart #define TIMER_MIRAGE_CHECKMOVEMENT (DP88_TIMER|MISC|0x03) //!< Used by dp88_AR_MirageTank to test for movement to toggle mirage mode #define TIMER_TURRETSOUND (DP88_TIMER|MISC|0x04) //!< Used by dp88_turretSound to test for turret rotation #define TIMER_ROCKETEER_ENTERVEHICLE (DP88_TIMER|MISC|0x05) //!< Used by dp88_AR_Rocketeer to enter the flight vehicle #define TIMER_PARADROP_CHECKFALLRATE (DP88_TIMER|MISC|0x06) //!< Used by dp88_AR_Paradrop to check if the falling speed drops (ie: landed) #define TIMER_AMMO_ANIMATION (DP88_TIMER|MISC|0x07) //!< Used by dp88_Ammo_Animation to check for changes in ammo count -#define TIMER_CHECK_BASE_POWER_STATE (DP88_TIMER|MISC|0x08) //!< Used by any scripts which need to check if a base is still powered // ------------------------------------------------------------------------------------------------- // Veterancy group @@ -134,8 +133,6 @@ #define CUSTOM_AI_DISABLEAI (DP88_CUSTOM|AI|0x03) //!< Custom message that can be sent to a turret AI to disable it #define CUSTOM_AI_ENABLEAI (DP88_CUSTOM|AI|0x04) //!< Custom message that can be sent to a turret AI to enable it -#define TIMER_AI_THINK (DP88_TIMER|AI|0x01) //!< Fires every second to process AI actions such as checking target status - // ------------------------------------------------------------------------------------------------- // AR IFV group // ------------------------------------------------------------------------------------------------- @@ -161,20 +158,46 @@ /**************************** Unsorted customs and timers ****************************/ +//#define CUSTOM_PILOTED_VEHICLE_ID 10022554 +/*#define CUSTOM_TD_TARGET_ID 10022560 +#define CUSTOM_TD_TARGET_DIED 10022561 +#define CUSTOM_TD_TARGET_REPAIRED 10022562 +#define CUSTOM_TD_TD_DIED 10022563 +#define CUSTOM_TD_WAITINGFORPURCHASE 10022564 +#define CUSTOM_TD_PURCHASEWAIT_OK 10022565 +#define CUSTOM_TD_REPORTCREATION 10022566 +#define CUSTOM_TD_CONSOLEID 10022567 +#define CUSTOM_TD_DRIVEREXIT 10022568 +#define CUSTOM_KILLSELF 10022569 +#define CUSTOM_RESET_SHIELD 10022570*/ // Customs for Prism Tower script #define CUSTOM_PRISMTOWER_REQUEST_CHARGING 1144060001 #define CUSTOM_PRISMTOWER_STOP_CHARGING 1144060002 +// Customs for custom turret AI scripts + + + + + +#define TIMER_CHECK_BASE_POWER_STATE 10055220 // Used by scripts which need to check if a base is still powered #define TIMER_CLEG_PHASEDEATH 10055222 #define TIMER_CLEG_CHECKDROPOBJ 10055223 #define TIMER_CLEG_CHECKRELEASETARGET 10055224 +/*#define TIMER_TD_DO_DAMAGE 10055229 +#define TIMER_TD_PURCHASEWAIT 10055230 +#define TIMER_TD_PURCHASETIMEEXPIRED 10055231 +#define TIMER_TD_TRANSITIONS_ENABLE 10055232 +#define TIMER_TD_DIED_DRIVERFREE 10055233*/ #define TIMER_LINKHEALTH 10055235 #define TIMER_LINKVETPOINTS 10055236 #define TIMER_HEALTHARMOURREGENTICK 10055239 + // Timers for prism towers and tesla coils +#define TIMER_CUSTOMAI_THINK 2244040001 //!< Timer that fires every 1 second in my custom AI scripts to update target state etc #define TIMER_TESLACOIL_DECREMENT_CHARGE 2244040002 // Timers for dp88_chronoTank Only in sourceold/scripts: dp88_securitySystem.cpp Only in sourceold/scripts: dp88_securitySystem.h diff -uwr source/scripts/dp88_veterancy.cpp sourceold/scripts/dp88_veterancy.cpp --- source/scripts/dp88_veterancy.cpp 2014-02-08 06:34:48.033203100 +1000 +++ sourceold/scripts/dp88_veterancy.cpp 2014-02-03 06:32:47.699031200 +1000 @@ -418,47 +418,48 @@ if ( obj == NULL || deregistered ) return; - GameObject* chevron = NULL; - if ( obj->As_SoldierGameObj() ) { // Create promoted chevron and record it's ID - GameObject* promotionChevron = Create_Object_Attach_To_Object(obj, (2==currentLevel) ? "chev_inf_elite_promotion" : "chev_inf_veteran_promotion", "Worldbox"); + GameObject* promotionChevron = Commands->Create_Object_At_Bone( obj, ( currentLevel == 2 ) ? "chev_inf_elite_promotion" : "chev_inf_veteran_promotion", "Worldbox" ); + Commands->Set_Facing( promotionChevron, Commands->Get_Facing( obj ) ); promotionChevronObjId = Commands->Get_ID( promotionChevron ); // Start timer to destroy the promotion chevron Commands->Start_Timer( obj, this, 2.5f, TIMER_VETERANCY_EXPIRE_PROMOTION_CHEVRON ); - // Now create the main chevron - chevron = Create_Object_Attach_To_Object(obj, (2==currentLevel) ? "chev_inf_elite" : "chev_inf_veteran", "Worldbox"); + + // Now create new chevron and record it's ID + GameObject* chevron = Commands->Create_Object_At_Bone( obj, ( currentLevel == 2 ) ? "chev_inf_elite" : "chev_inf_veteran", "Worldbox" ); + Commands->Set_Facing( chevron, Commands->Get_Facing( obj ) ); + Commands->Attach_To_Object_Bone( chevron, obj, "Worldbox" ); + chevronObjId = Commands->Get_ID( chevron ); } else if ( obj->As_VehicleGameObj() ) { // Create promoted chevron and record it's ID - GameObject* promotionChevron = Create_Object_Attach_To_Object(obj, (2==currentLevel) ? "chev_veh_elite_promotion" : "chev_veh_veteran_promotion", "Worldbox"); + GameObject* promotionChevron = Commands->Create_Object_At_Bone( obj, ( currentLevel == 2 ) ? "chev_veh_elite_promotion" : "chev_veh_veteran_promotion", "chevBone" ); + Commands->Set_Facing( promotionChevron, Commands->Get_Facing( obj ) ); promotionChevronObjId = Commands->Get_ID( promotionChevron ); // Start timer to destroy the promotion chevron Commands->Start_Timer( obj, this, 2.5f, TIMER_VETERANCY_EXPIRE_PROMOTION_CHEVRON ); - // Now create the main chevron - chevron = Create_Object_Attach_To_Object(obj, (2==currentLevel) ? "chev_veh_elite" : "chev_veh_veteran", "chevBone"); - } - // Save the chevron ID, update its rendering state and start the think timer if required - if ( NULL != chevron ) - { + // Now create new chevron and record it's ID + GameObject* chevron = Commands->Create_Object_At_Bone( obj, ( currentLevel == 2 ) ? "chev_veh_elite" : "chev_veh_veteran", "chevBone" ); + Commands->Set_Facing( chevron, Commands->Get_Facing( obj ) ); + Commands->Attach_To_Object_Bone( chevron, obj, "chevBone" ); chevronObjId = Commands->Get_ID( chevron ); - Commands->Set_Is_Rendered(chevron, chevronVisible); + } if (startThinkTimer) { Commands->Start_Timer(obj, this, 1.0f, TIMER_VETERANCY_CHEVRON_VISIBILITY_THINK); } } -} /* Clear chevrons */ diff -uwr source/scripts/engine_common.cpp sourceold/scripts/engine_common.cpp --- source/scripts/engine_common.cpp 2014-02-09 10:10:15.902992200 +1000 +++ sourceold/scripts/engine_common.cpp 2013-10-30 23:16:13.240234300 +1000 @@ -57,7 +57,7 @@ case 0: function = a; break; case 1: function = b; break; case 4: function = c; break; - default: TT_ASSUME_UNREACHABLE; + default: TT_UNREACHABLE; } TT_ASSERT(function != nullptr); diff -uwr source/scripts/engine_game.h sourceold/scripts/engine_game.h --- source/scripts/engine_game.h 2014-02-08 06:34:48.036132800 +1000 +++ sourceold/scripts/engine_game.h 2013-10-30 23:16:13.248046800 +1000 @@ -134,7 +134,7 @@ bool SCRIPTS_API Is_Building_Dead(GameObject *obj); /*! -* \ingroup api_objects_find +* \ingroup api_objectfind * Find the first building of a given building type for this team * * \param[in] team @@ -149,7 +149,7 @@ GameObject SCRIPTS_API *Find_Building_By_Type(int team,int type); /*! -* \ingroup api_objects_find +* \ingroup api_objectfind * Find the first base defense building for this team (if any) * * \param[in] Team @@ -171,7 +171,7 @@ GameObject SCRIPTS_API *Create_Building(const char *preset,const Vector3 & Position); //Create a building controller /*! -* \ingroup api_objects_find +* \ingroup api_objectfind * Find the AI harvester for a team (if any) * * \param[in] team @@ -263,7 +263,7 @@ int SCRIPTS_API Get_Building_Count_Team(int Team); /*! -* \ingroup api_objects_find +* \ingroup api_objectfind * Find the first building for this team * * \param[in] Team @@ -275,7 +275,7 @@ GameObject SCRIPTS_API *Find_Building_By_Team(int Team); /*! -* \ingroup api_objects_find +* \ingroup api_objectfind * Find the first building of a given preset type for this team * * \param[in] Team @@ -290,7 +290,7 @@ GameObject SCRIPTS_API *Find_Building_By_Preset(int Team,const char *Preset_Name); /*! -* \ingroup api_objects_find +* \ingroup api_objectfind * Find the first power plant for this team (if any) * * \param[in] Team @@ -302,7 +302,7 @@ GameObject SCRIPTS_API *Find_Power_Plant(int Team); /*! -* \ingroup api_objects_find +* \ingroup api_objectfind * Find the first construction yard for this team (if any) * * \param[in] Team @@ -314,7 +314,7 @@ GameObject SCRIPTS_API *Find_Construction_Yard(int Team); /*! -* \ingroup api_objects_find +* \ingroup api_objectfind * Find the first refinery for this team (if any) * * \param[in] Team @@ -326,7 +326,7 @@ GameObject SCRIPTS_API *Find_Refinery(int Team); /*! -* \ingroup api_objects_find +* \ingroup api_objectfind * Find the first repair bay for this team (if any) * * \param[in] Team @@ -338,7 +338,7 @@ GameObject SCRIPTS_API *Find_Repair_Bay(int Team); /*! -* \ingroup api_objects_find +* \ingroup api_objectfind * Find the first soldier factory for this team (if any) * * \param[in] Team @@ -350,7 +350,7 @@ GameObject SCRIPTS_API *Find_Soldier_Factory(int Team); /*! -* \ingroup api_objects_find +* \ingroup api_objectfind * Find the first vehicle factory for this team (if any) * * \param[in] Team @@ -362,7 +362,7 @@ GameObject SCRIPTS_API *Find_Vehicle_Factory(int Team); /*! -* \ingroup api_objects_find +* \ingroup api_objectfind * Find the first com center for this team (if any) * * \param[in] Team @@ -374,7 +374,7 @@ GameObject SCRIPTS_API *Find_Com_Center(int Team); /*! -* \ingroup api_objects_find +* \ingroup api_objectfind * Find the first special building for this team (if any) * * \param[in] Team @@ -386,7 +386,7 @@ GameObject SCRIPTS_API *Find_Special(int Team); /*! -* \ingroup api_objects_find +* \ingroup api_objectfind * Find the first naval factory for this team (if any) * * \param[in] Team @@ -398,7 +398,7 @@ GameObject SCRIPTS_API *Find_Naval_Factory(int Team); /*! -* \ingroup api_objects_find +* \ingroup api_objectfind * Find the first tech center for this team (if any) * * \param[in] Team @@ -410,7 +410,7 @@ GameObject SCRIPTS_API *Find_Tech_Center(int Team); /*! -* \ingroup api_objects_find +* \ingroup api_objectfind * Find the first helipad for this team (if any) * * \param[in] Team @@ -422,7 +422,7 @@ GameObject SCRIPTS_API *Find_Helipad(int Team); /*! -* \ingroup api_objects_find +* \ingroup api_objectfind * Find the first shrine for this team (if any) * * \param[in] Team diff -uwr source/scripts/engine_obj2.cpp sourceold/scripts/engine_obj2.cpp --- source/scripts/engine_obj2.cpp 2014-02-08 06:34:48.054687500 +1000 +++ sourceold/scripts/engine_obj2.cpp 2013-11-18 10:02:55.715820400 +1000 @@ -652,16 +652,4 @@ return Return; } -SCRIPTS_API GameObject* Create_Object_Attach_To_Object(GameObject* host, const char* preset, const char* bone = NULL) -{ - GameObject* obj = Commands->Create_Object_At_Bone(host, "preset", (NULL != bone) ? bone : "origin"); - if ( NULL != obj ) - { - Commands->Set_Facing(obj, Commands->Get_Facing(host)); - Commands->Attach_To_Object_Bone(obj, host, (NULL != bone) ? bone : "origin"); - } - - return obj; -} - REF_DEF2(float, SmartGameObj::GlobalSightRangeScale, 0x00811E64, 0x0081103C); diff -uwr source/scripts/engine_obj2.h sourceold/scripts/engine_obj2.h --- source/scripts/engine_obj2.h 2014-02-08 06:34:48.059570300 +1000 +++ sourceold/scripts/engine_obj2.h 2013-11-12 23:55:36.739257800 +1000 @@ -49,20 +49,4 @@ SCRIPTS_API int Get_Player_Count_In_Zone(GameObject *obj,int Team); //Get the player count in a zone SCRIPTS_API int Get_Object_Count_In_Zone(GameObject *obj,int Team); //Get the object count in a zone SCRIPTS_API bool Is_Stealth_Enabled(GameObject *obj); //Is stealth enabled - -/*! -* \brief Create an object and attach it to a bone -* \author Daniel Paul (danpaul88@yahoo.co.uk) -* -* Creates a new instance of the named preset and attaches it to a specific bone on the specified -* object, or the origin of the object if no bone is specified. -* -* \param[in] host -* The host object to which the new object should be attached -* \param[in] preset -* The name of the preset to create an instance of -* \param[in] bone -* (Optional) The name of the bone on the host object to which the object should be attached -*/ -SCRIPTS_API GameObject* Create_Object_Attach_To_Object(GameObject* host, const char* preset, const char* bone = NULL); #endif diff -uwr source/scripts/engine_script.h sourceold/scripts/engine_script.h --- source/scripts/engine_script.h 2014-02-08 06:34:48.062500000 +1000 +++ sourceold/scripts/engine_script.h 2013-08-28 03:47:50.487304600 +1000 @@ -39,7 +39,7 @@ /*! * \brief Find Objects With Script - Distance Sorted * \author Daniel Paul (danpaul88@yahoo.co.uk) -* \ingroup api_objects_find +* \ingroup api_objectfind * * Finds all GameObjects with one or more instances of the specified script attached and returns them * in a list which is sorted by the distance from that object to a specified position diff -uwr source/scripts/groups.dox sourceold/scripts/groups.dox --- source/scripts/groups.dox 2014-02-08 06:34:48.065429600 +1000 +++ sourceold/scripts/groups.dox 2013-11-07 17:16:06.539062500 +1000 @@ -142,16 +142,9 @@ */ /*! - * \defgroup api_objects Engine API - Object Management +* \defgroup api_objectfind Engine API - Object Find / Search * \ingroup api * - * Engine API commands related to management of game objects - */ - - /*! - * \defgroup api_objects_find Engine API - Object Find / Search - * \ingroup api_objects - * * Engine API commands related to finding one or more game objects that meet specific criteria. */ diff -uwr source/scripts/scripts.vcxproj sourceold/scripts/scripts.vcxproj --- source/scripts/scripts.vcxproj 2014-02-08 06:34:48.069335900 +1000 +++ sourceold/scripts/scripts.vcxproj 2013-11-10 21:15:22.258164000 +1000 @@ -408,6 +408,7 @@ + @@ -582,6 +583,7 @@ + diff -uwr source/scripts/scripts.vcxproj.filters sourceold/scripts/scripts.vcxproj.filters --- source/scripts/scripts.vcxproj.filters 2014-02-08 06:34:48.072265600 +1000 +++ sourceold/scripts/scripts.vcxproj.filters 2013-11-10 21:15:22.267929600 +1000 @@ -47,6 +47,9 @@ 01. Sources + + 01. Sources + 01. Sources @@ -427,6 +430,9 @@ 02. Headers + + 02. Headers + 02. Headers diff -uwr source/shared/shared.vcxproj sourceold/shared/shared.vcxproj --- source/shared/shared.vcxproj 2014-02-08 06:34:13.611328100 +1000 +++ sourceold/shared/shared.vcxproj 2013-10-30 23:16:15.301757800 +1000 @@ -33,9 +33,11 @@ + +