Command and Conquer: Renegade Official Forums - RDF feed
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
I made an airstrike funtion. Again I called it via a chat hook but it can be called in a number of ways. The function chooses a working enemy building at random (this part is thanks to WhiteDragon, you have no idea how long and how many attempts it took to actually get that part right). Then either Nod lear jets or a10 bombers start flying over. One of them drops off a small payload to the random building an causes it to lose 50% of it's health. The sounds and the rest of the planes flying over make it really realistic to be honest, I think it's quite smooth. I set the a10 and lear jet to un-teamed via the objects.gm file because they count towards the vehichle limit otherwise. There are other ways of getting around that, but this seemed easiest. I think I remember a slight issue with it with regards to the cinematics looping after being called. I'm sure that's just changing a 1 to a 0 in the text file somewhere after the animation. Here's a video of it, it's 21mb long, but you should get a half decent download speed. It's worth watching even if you arean't going to put it on your server, just to see it in-game. It's a bit long, and I sound half asleep (because I was), but it's fun to see if you havn't before: http://www.mp-gaming.com/reborn/movies/air_strike2.wmv Here's how I made it work: ///////////////////////// ///////////////////////// //// GDI A10 strike ///// ///////////////////////// ///////////////////////// void reb_GDI_a10_strike::Created(GameObject *obj) { Commands->Create_2D_WAV_Sound("m00evan_dsgn0073i1evan_snd.wav"); Console_Input("msg Warning!!!"); Console_Input("msg A-10 strike inbound at Nod's position"); GameObject *BuildingObj = Get_Random_Building(0); BuildingID = Commands->Get_ID(BuildingObj); A10ID = Commands->Get_ID(Commands->Create_Object("Invisible_Object",Commands->Get_Position(BuildingObj))); Commands->Start_Timer(obj,this,3.0f,1); Commands->Start_Timer(obj,this,6.0f,2); Commands->Start_Timer(obj,this,9.0f,3); Commands->Start_Timer(obj,this,10.0f,4); Commands->Start_Timer(obj,this,17.5f,5); Commands->Start_Timer(obj,this,25.5f,6); } void reb_GDI_a10_strike::Timer_Expired(GameObject *obj, int number) { GameObject *thebuilding = Commands->Find_Object(BuildingID); GameObject *a101 = Commands->Find_Object(A10ID); Vector3 position = Commands->Get_Position(thebuilding); if (number == 1){ Commands->Create_2D_WAV_Sound("m00evan_dsgn0014i1evan_snd.wav"); } if (number == 2){ Commands->Create_2D_WAV_Sound("m00evan_dsgn0066i1evan_snd.wav"); } if (number == 3){ Commands->Attach_Script(a101,"Test_Cinematic","a-10_1.txt"); Commands->Attach_Script(a101,"Test_Cinematic","a-10_2.txt"); Commands->Attach_Script(a101,"Test_Cinematic","a-10_3.txt"); Commands->Attach_Script(a101,"Test_Cinematic","a-10_4.txt"); Commands->Attach_Script(a101,"Test_Cinematic","a-10_5.txt"); Commands->Attach_Script(a101,"Test_Cinematic","a-10_6.txt"); } if (number == 4){ Commands->Attach_Script(a101,"Test_Cinematic","A-10_bomb.txt"); } if (number == 5){ Commands->Create_2D_WAV_Sound("mx0_a-10_166.wav"); Commands->Attach_Script(a101,"Test_Cinematic","a-10_1.txt"); Commands->Attach_Script(a101,"Test_Cinematic","a-10_4.txt"); Commands->Attach_Script(a101,"Test_Cinematic","a-10_5.txt"); Commands->Attach_Script(a101,"Test_Cinematic","a-10_6.txt"); } if (number == 6){ Commands->Create_Explosion("Air_Explosion_Death",position,a101); Commands->Attach_Script(a101,"Test_Cinematic","a-10_2.txt"); Commands->Attach_Script(a101,"Test_Cinematic","a-10_3.txt"); float buildinghealth = Commands->Get_Health(thebuilding); Commands->Set_Health(thebuilding,(buildinghealth/2)); Commands->Destroy_Object(a101); } } ///////////////////////// ///////////////////////// //// Nod Jet strike ///// ///////////////////////// ///////////////////////// void reb_Nod_Jet_strike::Created(GameObject *obj) { Commands->Create_2D_WAV_Sound("m00evan_dsgn0073i1evan_snd.wav"); Console_Input("msg Warning!!!"); Console_Input("msg Lear Jet strike inbound at GDI's position"); GameObject *BuildingObj = Get_Random_Building(1); BuildingID = Commands->Get_ID(BuildingObj); A10ID = Commands->Get_ID(Commands->Create_Object("Invisible_Object",Commands->Get_Position(BuildingObj))); Commands->Start_Timer(obj,this,3.0f,1); Commands->Start_Timer(obj,this,6.0f,2); Commands->Start_Timer(obj,this,9.0f,3); Commands->Start_Timer(obj,this,10.0f,4); Commands->Start_Timer(obj,this,23.5f,5); Commands->Start_Timer(obj,this,25.5f,6); } void reb_Nod_Jet_strike::Timer_Expired(GameObject *obj, int number) { GameObject *thebuilding = Commands->Find_Object(BuildingID); GameObject *a101 = Commands->Find_Object(A10ID); Vector3 position = Commands->Get_Position(thebuilding); if(number == 1){ Commands->Create_2D_WAV_Sound("m00gnod_hesx0007r3nors_snd.wav"); } if(number == 2){ Commands->Create_2D_WAV_Sound("m00evan_dsgn0014i1evan_snd.wav"); } if(number == 3){ Commands->Attach_Script(a101,"Test_Cinematic","jet_1.txt"); Commands->Attach_Script(a101,"Test_Cinematic","jet_2.txt"); Commands->Attach_Script(a101,"Test_Cinematic","jet_3.txt"); Commands->Attach_Script(a101,"Test_Cinematic","jet_4.txt"); Commands->Attach_Script(a101,"Test_Cinematic","jet_5.txt"); Commands->Attach_Script(a101,"Test_Cinematic","jet_6.txt"); } if(number == 4){ Commands->Attach_Script(a101,"Test_Cinematic","Jet_bomb.txt"); } if(number == 5){ Commands->Create_2D_WAV_Sound("m00itoc_010in_ners_snd.wav"); Commands->Attach_Script(a101,"Test_Cinematic","jet_1.txt"); Commands->Attach_Script(a101,"Test_Cinematic","jet_2.txt"); Commands->Attach_Script(a101,"Test_Cinematic","jet_6.txt"); Commands->Attach_Script(a101,"Test_Cinematic","jet_3.txt"); Commands->Attach_Script(obj,"reb_Nod_Jet_strike7",""); } if(number == 6){ Commands->Create_Explosion("Air_Explosion_Death",position,a101); Commands->Attach_Script(a101,"Test_Cinematic","jet_6.txt"); Commands->Attach_Script(a101,"Test_Cinematic","jet_3.txt"); Commands->Attach_Script(a101,"Test_Cinematic","jet_4.txt"); Commands->Attach_Script(a101,"Test_Cinematic","jet_5.txt"); float buildinghealth = Commands->Get_Health(thebuilding); Commands->Set_Health(thebuilding,(buildinghealth/2)); } } ScriptRegistrant<reb_GDI_a10_strike> reb_GDI_a10_strike_Registrant("reb_GDI_a10_strike",""); ScriptRegistrant<reb_Nod_Jet_strike> reb_Nod_Jet_strike_Registrant("reb_Nod_Jet_strike",""); class reb_GDI_a10_strike : public ScriptImpClass { void Created(GameObject *obj); void Timer_Expired(GameObject *obj,int number); int BuildingID; int A10ID; }; class reb_Nod_Jet_strike : public ScriptImpClass { void Created(GameObject *obj); void Timer_Expired(GameObject *obj,int number); int BuildingID; int A10ID; }; This goes in the engine_gm.cpp file, and is worth making a topic about all by itself. WhiteDragon made the final solution after some really good coders looked at the problem. The function returns a working building for the team specified at random: GameObject * Get_Random_Building(int Team) { std::vector<GameObject*> Buildings; GenericSLNode *x = BuildingGameObjList->HeadNode; while (x != 0) { GameObject *obj = (GameObject *)x->NodeData; if (obj && (Get_Object_Type(obj) == Team || Team == 2) && !Is_Building_Dead(obj)) { Buildings.push_back(obj); } x = x->NodeNext; } if (!Buildings.empty()) { int Rand = Commands->Get_Random_Int(0,Buildings.size()); return Buildings[Rand]; } return 0; } GameObject * Get_Random_Building(int Team); Here are the conematic files that are called: Jet_bomb.txt ;_________________________________________ ; ; Available Cinematic Script Commands ; ; time/frame Create_Object, id (slot), preset_name, x, y, z, facing, animation ; id can be -1 to mean do not store this object, and do not destroy ; 0 Create_Object, 0, .44 Magnum, 0, 0, 0, 180, "Human.jump" ; ; time/frame Destroy_Object, id (slot) ; 0 Destroy_Object, 0 ; ; time/frame Play_Animation, id (slot), animation_name, looping, sub_obj_name ; 0 Play_Animation, 0, "Human.Jump", false ; ; time/frame Control_Camera, id ( slot ) ; use id -1 for disabling control; ; note this will also disable star control and disbale the hud ; 0 Control_Camera, 0 ; ;_________________________________________ ;******************* CHEAT SHEET ****************************** ;Start frame create_object slot number model x,y,z,facing animation name( model*hierarchy*.anim ) ;Start frame Play_Animation slot number anim name ( model*hierarchy*.anim ) looping Sub Object ;Start frame Play_Audio wave filename slot number bone name ; * no slot # / bone name = 2D Audio ;0= NO LOOP ( kills object when finshed ) 1= LOOP ;************************* LEVEL 1: Solo A10 X1A_FP10_A0 ************************ ; This is a solo A10. ; ;*************************************************************************************** ; ****************************** Vehicle -1 Create_Object, 7, "v_jet" -1 Attach_Script, 7, "M01_Flyover_Generic_Script_JDG", "FUSELAGE" -1 Play_Animation, 7, "VF_GDI A10.VF_GDI A10", 1 -470 Destroy_Object, 7 ; ****************************** Flying Animation -1 Create_Object, 8, "X1A_FP10_A0" -1 Play_Animation, 8, "X1A_FP10_A0.X1A_FP10_A0", 1 -470 Destroy_Object, 8 -1 Attach_To_Bone, 7, 8, "BN_FP10_A0" ; ****************************** Nuke Cloud ; ****************************** Nuke Smoke -495 Create_Object, 9, "ag_nuke_smoke" -500 Destroy_Object, 9 ; ****************************** Signal Flare -1 Create_Real_Object, 10, "Refinery_Evac_Point" -450 Destroy_Object, 10 ;******************************* A-10 Bomb Drop -380 Create_Object, 11, "X5D_PARACHUTE", -380 Play_Animation, 11, "X5D_PARACHUTE.X5D_PARAC_2" A-10_bomb.txt ;_________________________________________ ; ; Available Cinematic Script Commands ; ; time/frame Create_Object, id (slot), preset_name, x, y, z, facing, animation ; id can be -1 to mean do not store this object, and do not destroy ; 0 Create_Object, 0, .44 Magnum, 0, 0, 0, 180, "Human.jump" ; ; time/frame Destroy_Object, id (slot) ; 0 Destroy_Object, 0 ; ; time/frame Play_Animation, id (slot), animation_name, looping, sub_obj_name ; 0 Play_Animation, 0, "Human.Jump", false ; ; time/frame Control_Camera, id ( slot ) ; use id -1 for disabling control; ; note this will also disable star control and disbale the hud ; 0 Control_Camera, 0 ; ;_________________________________________ ;******************* CHEAT SHEET ****************************** ;Start frame create_object slot number model x,y,z,facing animation name( model*hierarchy*.anim ) ;Start frame Play_Animation slot number anim name ( model*hierarchy*.anim ) looping Sub Object ;Start frame Play_Audio wave filename slot number bone name ; * no slot # / bone name = 2D Audio ;0= NO LOOP ( kills object when finshed ) 1= LOOP ;************************* LEVEL 1: Solo A10 X1A_FP10_A0 ************************ ; This is a solo A10. ; ;*************************************************************************************** ; ****************************** Vehicle -1 Create_Object, 7, "VF_GDI A10" -1 Attach_Script, 7, "M01_Flyover_Generic_Script_JDG", "FUSELAGE" -1 Play_Animation, 7, "VF_GDI A10.VF_GDI A10", 1 -470 Destroy_Object, 7 ; ****************************** Flying Animation -1 Create_Object, 8, "X1A_FP10_A0" -1 Play_Animation, 8, "X1A_FP10_A0.X1A_FP10_A0", 1 -470 Destroy_Object, 8 -1 Attach_To_Bone, 7, 8, "BN_FP10_A0" ; ****************************** Nuke Cloud ; ****************************** Nuke Smoke -495 Create_Object, 9, "ag_nuke_smoke" -500 Destroy_Object, 9 ; ****************************** Signal Flare -1 Create_Real_Object, 10, "Refinery_Evac_Point" -450 Destroy_Object, 10 ;******************************* A-10 Bomb Drop -380 Create_Object, 11, "X5D_PARACHUTE", -380 Play_Animation, 11, "X5D_PARACHUTE.X5D_PARAC_2" jet_1.txt ;_________________________________________ ; ; Available Cinematic Script Commands ; ; time/frame Create_Object, id (slot), preset_name, x, y, z, facing, animation ; id can be -1 to mean do not store this object, and do not destroy ; 0 Create_Object, 0, .44 Magnum, 0, 0, 0, 180, "Human.jump" ; ; time/frame Destroy_Object, id (slot) ; 0 Destroy_Object, 0 ; ; time/frame Play_Animation, id (slot), animation_name, looping, sub_obj_name ; 0 Play_Animation, 0, "Human.Jump", false ; ; time/frame Control_Camera, id ( slot ) ; use id -1 for disabling control; ; note this will also disable star control and disbale the hud ; 0 Control_Camera, 0 ; ;_________________________________________ ;******************* CHEAT SHEET ****************************** ;Start frame create_object slot number model x,y,z,facing animation name( model*hierarchy*.anim ) ;Start frame Play_Animation slot number anim name ( model*hierarchy*.anim ) looping Sub Object ;Start frame Play_Audio wave filename slot number bone name ; * no slot # / bone name = 2D Audio ;0= NO LOOP ( kills object when finshed ) 1= LOOP ;************************* LEVEL 3: HOVERCRAFT EXPLODE AT BEACH ************************ ; ****************************** Character Bone -1 Create_Real_Object, 1, "Nod_Jet" -1 Play_Animation, 1, "vf_gdi a10.vf_gdi a10", 1 -600 destroy_object, 1 ; ****************************** Path -1 Create_Object, 2, "X3_a10_dep1", 0, 0, 0, 0 -1 Play_Animation, 2, "X3_a10_dep1.X3_a10_dep1", 1 -600 Destroy_Object, 2 -1 Attach_To_Bone, 1, 2, "BN_a-10_004" Jet_2.txt ;_________________________________________ ; ; Available Cinematic Script Commands ; ; time/frame Create_Object, id (slot), preset_name, x, y, z, facing, animation ; id can be -1 to mean do not store this object, and do not destroy ; 0 Create_Object, 0, .44 Magnum, 0, 0, 0, 180, "Human.jump" ; ; time/frame Destroy_Object, id (slot) ; 0 Destroy_Object, 0 ; ; time/frame Play_Animation, id (slot), animation_name, looping, sub_obj_name ; 0 Play_Animation, 0, "Human.Jump", false ; ; time/frame Control_Camera, id ( slot ) ; use id -1 for disabling control; ; note this will also disable star control and disbale the hud ; 0 Control_Camera, 0 ; ;_________________________________________ ;******************* CHEAT SHEET ****************************** ;Start frame create_object slot number model x,y,z,facing animation name( model*hierarchy*.anim ) ;Start frame Play_Animation slot number anim name ( model*hierarchy*.anim ) looping Sub Object ;Start frame Play_Audio wave filename slot number bone name ; * no slot # / bone name = 2D Audio ;0= NO LOOP ( kills object when finshed ) 1= LOOP ;************************* LEVEL 3: HOVERCRAFT EXPLODE AT BEACH ************************ ; ****************************** Character Bone -1 Create_Real_Object, 1, "Nod_Jet" -1 Play_Animation, 1, "vf_gdi a10.vf_gdi a10", 1 -1200 destroy_object, 1 ; ****************************** Path -1 Create_Object, 2, "X3_a10_dep2", 0, 0, 0, 0 -1 Play_Animation, 2, "X3_a10_dep2.X3_a10_dep2", 1 -1200 Destroy_Object, 2 -1 Attach_To_Bone, 1, 2, "BN_a-10_005" Jet_3.txt ;_________________________________________ ; ; Available Cinematic Script Commands ; ; time/frame Create_Object, id (slot), preset_name, x, y, z, facing, animation ; id can be -1 to mean do not store this object, and do not destroy ; 0 Create_Object, 0, .44 Magnum, 0, 0, 0, 180, "Human.jump" ; ; time/frame Destroy_Object, id (slot) ; 0 Destroy_Object, 0 ; ; time/frame Play_Animation, id (slot), animation_name, looping, sub_obj_name ; 0 Play_Animation, 0, "Human.Jump", false ; ; time/frame Control_Camera, id ( slot ) ; use id -1 for disabling control; ; note this will also disable star control and disbale the hud ; 0 Control_Camera, 0 ; ;_________________________________________ ;******************* CHEAT SHEET ****************************** ;Start frame create_object slot number model x,y,z,facing animation name( model*hierarchy*.anim ) ;Start frame Play_Animation slot number anim name ( model*hierarchy*.anim ) looping Sub Object ;Start frame Play_Audio wave filename slot number bone name ; * no slot # / bone name = 2D Audio ;0= NO LOOP ( kills object when finshed ) 1= LOOP ;************************* LEVEL 3: HOVERCRAFT EXPLODE AT BEACH ************************ ; ****************************** Character Bone -1 Create_Real_Object, 1, "Nod_Jetr" -1 Play_Animation, 1, "vf_gdi a10.vf_gdi a10", 1 -600 destroy_object, 1 ; ****************************** Path -1 Create_Object, 2, "X3_a10_strk1", 0, 0, 0, 0 -1 Play_Animation, 2, "X3_a10_strk1.X3_a10_strk1", 1 -600 Destroy_Object, 2 -1 Attach_To_Bone, 1, 2, "BN_a-10_000" Jet_4.txt ;_________________________________________ ; ; Available Cinematic Script Commands ; ; time/frame Create_Object, id (slot), preset_name, x, y, z, facing, animation ; id can be -1 to mean do not store this object, and do not destroy ; 0 Create_Object, 0, .44 Magnum, 0, 0, 0, 180, "Human.jump" ; ; time/frame Destroy_Object, id (slot) ; 0 Destroy_Object, 0 ; ; time/frame Play_Animation, id (slot), animation_name, looping, sub_obj_name ; 0 Play_Animation, 0, "Human.Jump", false ; ; time/frame Control_Camera, id ( slot ) ; use id -1 for disabling control; ; note this will also disable star control and disbale the hud ; 0 Control_Camera, 0 ; ;_________________________________________ ;******************* CHEAT SHEET ****************************** ;Start frame create_object slot number model x,y,z,facing animation name( model*hierarchy*.anim ) ;Start frame Play_Animation slot number anim name ( model*hierarchy*.anim ) looping Sub Object ;Start frame Play_Audio wave filename slot number bone name ; * no slot # / bone name = 2D Audio ;0= NO LOOP ( kills object when finshed ) 1= LOOP ;************************* LEVEL 3: HOVERCRAFT EXPLODE AT BEACH ************************ ; ****************************** Character Bone -1 Create_Real_Object, 1, "Nod_Jet" -1 Play_Animation, 1, "vf_gdi a10.vf_gdi a10", 1 -600 destroy_object, 1 ; ****************************** Path -1 Create_Object, 2, "X3_a10_strk2", 0, 0, 0, 0 -1 Play_Animation, 2, "X3_a10_strk2.X3_a10_strk2", 1 -600 Destroy_Object, 2 -1 Attach_To_Bone, 1, 2, "BN_a-10_001" Jet_5.txt ;_________________________________________ ; ; Available Cinematic Script Commands ; ; time/frame Create_Object, id (slot), preset_name, x, y, z, facing, animation ; id can be -1 to mean do not store this object, and do not destroy ; 0 Create_Object, 0, .44 Magnum, 0, 0, 0, 180, "Human.jump" ; ; time/frame Destroy_Object, id (slot) ; 0 Destroy_Object, 0 ; ; time/frame Play_Animation, id (slot), animation_name, looping, sub_obj_name ; 0 Play_Animation, 0, "Human.Jump", false ; ; time/frame Control_Camera, id ( slot ) ; use id -1 for disabling control; ; note this will also disable star control and disbale the hud ; 0 Control_Camera, 0 ; ;_________________________________________ ;******************* CHEAT SHEET ****************************** ;Start frame create_object slot number model x,y,z,facing animation name( model*hierarchy*.anim ) ;Start frame Play_Animation slot number anim name ( model*hierarchy*.anim ) looping Sub Object ;Start frame Play_Audio wave filename slot number bone name ; * no slot # / bone name = 2D Audio ;0= NO LOOP ( kills object when finshed ) 1= LOOP ;************************* LEVEL 3: HOVERCRAFT EXPLODE AT BEACH ************************ ; ****************************** Character Bone -1 Create_Real_Object, 1, "Nod_Jet" -1 Play_Animation, 1, "vf_gdi a10.vf_gdi a10", 1 -600 destroy_object, 1 ; ****************************** Path -1 Create_Object, 2, "X3_a10_strk3", 0, 0, 0, 0 -1 Play_Animation, 2, "X3_a10_strk3.X3_a10_strk3", 1 -600 Destroy_Object, 2 -1 Attach_To_Bone, 1, 2, "BN_a-10_002" Jet_6.txt ;_________________________________________ ; ; Available Cinematic Script Commands ; ; time/frame Create_Object, id (slot), preset_name, x, y, z, facing, animation ; id can be -1 to mean do not store this object, and do not destroy ; 0 Create_Object, 0, .44 Magnum, 0, 0, 0, 180, "Human.jump" ; ; time/frame Destroy_Object, id (slot) ; 0 Destroy_Object, 0 ; ; time/frame Play_Animation, id (slot), animation_name, looping, sub_obj_name ; 0 Play_Animation, 0, "Human.Jump", false ; ; time/frame Control_Camera, id ( slot ) ; use id -1 for disabling control; ; note this will also disable star control and disbale the hud ; 0 Control_Camera, 0 ; ;_________________________________________ ;******************* CHEAT SHEET ****************************** ;Start frame create_object slot number model x,y,z,facing animation name( model*hierarchy*.anim ) ;Start frame Play_Animation slot number anim name ( model*hierarchy*.anim ) looping Sub Object ;Start frame Play_Audio wave filename slot number bone name ; * no slot # / bone name = 2D Audio ;0= NO LOOP ( kills object when finshed ) 1= LOOP ;************************* LEVEL 3: HOVERCRAFT EXPLODE AT BEACH ************************ ; ****************************** Character Bone -1 Create_Real_Object, 1, "Nod_Jet" -1 Play_Animation, 1, "vf_gdi a10.vf_gdi a10", 1 -600 destroy_object, 1 ; ****************************** Path -1 Create_Object, 2, "X3_a10_strk4", 0, 0, 0, 0 -1 Play_Animation, 2, "X3_a10_strk4.X3_a10_strk4", 1 -600 Destroy_Object, 2 -1 Attach_To_Bone, 1, 2, "BN_a-10_003" The a-10_1(2,3,4,5,6) are the exact same as this, other then object created should be changed from "Nod_Jet" to "GDI_A10_Flyover". I hope you like it, and if you want to reply, I suggest no quotng
Hey Rborn I Watched The Video It Is Good How Do I Add It To M y Server
I made it specifically for SSGM, so your server would need to be running that. You need to download the source code to SSGM that comes with the binaries anyway. You can find this on the www.black-cell.net downloads page here http://black-cell.net/downloads/index.php?act=category&id=6 (you will want the win32 version). Then you open up the .sln file located in the source code folder with microsoft visual studio. If you do not have visual studio installed and set up, then you can see this post here created by JohnWill for exactly that purpose: http://www.renegadeforums.com/index.php?t=msg&goto=296486&rid=3415&s rch=express#msg_296486 You add most of the code to the gm_main.cpp file, but there is some that goes in the gm_main.h file and the engine_gm.cpp and the engine_gm.h file. Obviously you need to compile it aswell. The cinematics need to be copy/pasted into there own .txt files and named what I have put just above the code tags and placed in your servers data folder. You could call the function with a chat hook for testing, but ideally you will call the function some other way to add to gameplay. chat hook example: class GDIa10ChatCommand : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); Commands->Attach_Script(obj,"reb_GDI_a10_strike",""); } }; ChatCommandRegistrant<GDIa10ChatCommand> GDIa10ChatCommandReg("!a10g",CHATTYPE_TEAM,0,GAMEMODE_AOW); class NodjetChatCommand : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); Commands->Attach_Script(obj,"reb_Nod_Jet_strike",""); } }; ChatCommandRegistrant<NodjetChatCommand> NodjetChatCommandReg("!a10n",CHATTYPE_TEAM,0,GAMEMODE_AOW);
I Run SSGM And Lua Plugin V2.0 so do i follow the tutorial you sent in last post
This code is c++ not LUA, but the LUA plug-in will not harm it in any-way. If you get visual studio and the code to the right places. compile it and put it on your server then yes, you will be able to use the script.
lol whats with the sharing reborn
Hm, reborn are you done with renegade, or why are you realising all your code?
I'm not done with renegade. I am hoping to set a trend. If someone uses this code and the people in there server are happy with it then that's cool. If someone reads this and thinks of a way to adapt it to suit there needs then that's cool too. If it encourages others to post stuff then I might learn something, or it might give me inspiration, that's awesome. There are allot of reasons to release the code, I could go on for a long time talking about the pro's. I can't really see any cons. Sure I might have had a unique feature for my server. But I don't really think it matters how cool your server is, people only seem to join the a0 servers anyway. Besides, then people would only get to experiance it in one server. Plus, I am not the greatest programmer there is. Infact I am probably one of the most newbie programmers here. I really won't dispute that, there are allot better coders then me here. Allot better. So if I post this then there might be someone who see's it and makes it better. Whether they do it out of kindness, ego, boredom or whatever it doesn't really bother me. But they might make it more efficient, or have a better idea and make something more awesome. I have seen this kind of sharing, helping and collaberation on other game forums. Granted, they had more people that actually knew how to code, but it was really impressive to see people helping eachother out. There's few people here that do that. I don't know why. If I can encourage others to do the same then I will be really really pleased with myself.
youre posting commands that i already have... ps. i have 3 diffrent airstrukes
MadRockz wrote on Wed, 05 December 2007 10:11 youre posting commands that i already have... ps. i have 3 diffrent airstrukes Seeing as how anybody can now have an airstrike, and with the source code they can mix it up a bit. Why don't you release yours too?
cuz i dont wanted that all server have it, later all server´s will be the same. Then nobody get´s his 0wn Ideas... oh and its only for lua cuz i still cant add scripts to scripts.dll
MadRockz wrote on Wed, 05 December 2007 10:17 cuz i dont wanted that all server have it, later all server´s will be the same. Then nobody get´s his 0wn Ideas... That's the spirit.
if all servers starting to be same im going to work on my new Renegade Mode ...
What you should do is when you call a function which is supposed to return a pointer to something, check the pointer to make sure it isn't NULL. GameObject *a101 = Commands->Find_Object(A10ID); if(!a101) { //an error }
Quote: But I don't really think it matters how cool your server is, people only seem to join the a0 servers anyway. I think you are wrong, i dont have a really good a00 nick, but my server is unique and therefore popular. But its your code and your spent time, i can only say. Thx reborn for the code, i will add it to my aow mod.
Haven't watched the video yet so I don't know if it already does this. But perhaps you can make a way so that it doesn't work when there are enemy sam sites or something. But other than that, great job.
This would be good incorperated with Hex's Vet scriptys. IE Once you get promoted to level 3 or whatever, you gain access to the Airstrike Command which can be used once every 5 mins or so. The existing !veh and !weap etc are pretty lame tbh.
Can this be used in MP ractiece, and if so (or if not) how would I get it to work on my renegade FDS, and lol would it work in demo or SS? Thanks...
Quote: Jet_3.txt There is a wrong "Nod_Jetr"
The Elite Officer wrote on Wed, 05 December 2007 14:40 Can this be used in MP ractiece, and if so (or if not) how would I get it to work on my renegade FDS, and lol would it work in demo or SS? Thanks... It might working in multiplayer practice if you mod your client scripts.dll to include this. I haven't tried doing that. But I guess it could be possible to have all the features of SSGM in your single player mission and mulptiplay practice. I have no idea if it would work in the demop, I don;t know how much things differ. Tjere might be addresses and stuff that have changed that the rest of SSGM relies on. Show the code to the people who are making that demo server regulator thing, they might have a better clue. cAmpa wrote on Wed, 05 December 2007 18:52 Quote: Jet_3.txt There is a wrong "Nod_Jetr" Thanks man
None of the scripts.dll code is compatible with the demo version of renegade.
mhmm, after the attack, all the a10 and jets are looping and looping and looping. I think u forgot to kill the objects after attack?
cAmpa wrote on Wed, 05 December 2007 18:47 mhmm, after the attack, all the a10 and jets are looping and looping and looping. I think u forgot to kill the objects after attack? I found the same thing.. and as a result of this the team in which the vehicles belong to are at their vehicle limit..lol
read you buggers Quote: I set the a10 and lear jet to un-teamed via the objects.gm file because they count towards the vehichle limit otherwise. There are other ways of getting around that, but this seemed easiest. I think I remember a slight issue with it with regards to the cinematics looping after being called. I'm sure that's just changing a 1 to a 0 in the text file somewhere after the animation.
LOL, completely missed that Thanks Reborn!
Very nice Reborn! It looks pretty sweet. And you get props from me for sharing it. +10 Brownie points for Reborn.
Gen_Blacky wrote on Wed, 05 December 2007 08:11 lol whats with the sharing reborn Do not question! else he'll change his mind!
I think he's been waiting to release his scripts for a while because he's been testing/debugging/et cetera That, plus I think he's been busy with his personal life. ~MathK1LL
wow thats a lot of coding but fuck that looks so awsome man!
Sir Kane wrote on Sun, 09 December 2007 04:55 50% seems a little much. Could you help maybe remove some of the crap then?
Sir Kane wrote on Sun, 09 December 2007 05:50 What crap? You said it looked lake half of it wasn't needed. If it is bloated or poorly coded could you help?
reborn wrote on Wed, 05 December 2007 06:34 One of them drops off a small payload to the random building an causes it to lose 50% of it's health.
I'm temped too add this as a command to my veteran system
Hex wrote on Sun, 09 December 2007 07:24 I'm temped too add this as a command to my veteran system Go for it
reborn wrote on Sun, 09 December 2007 07:00 Hex wrote on Sun, 09 December 2007 07:24 I'm temped too add this as a command to my veteran system Go for it ^ Similar to how you can use certain "powers" once you reach a certain rank in C&C TW, and these powers can be used in conjunction with a tank rush or superweapon to pwn the enemy's base royally.
why cant i compile the file? im hitting (F7) but nothing happens, i got c++ 2008. can someone help me on that?
only compiling the original source of SSGM gives a problem
You're missing a library that you need to include(not "#include"). I forget the actual name of the .lib file you need to import but it starts with an 'a' :\ ~MathK1LL
He wanted a chat hook that made it cost a player 5000 credits to call in the airstrike. I made it for him. Here is a compiled version with source code: http://www.mp-gaming.com/reborns/coderelease/white.zip It really is only a cheap chat hook. I don't really recomend it tbh, my idea was to have the function called as some random event, or a power-up. Not based on credits. The chat hook can be used in team chat with !a10n and !a10g, both teams can use either one. He didn't ask for Nod to only use the Nod one and vise-versa, but really all you have to do to enable that is add to the conditional where I check for the credits the players has for there obj's team.
reborn wrote on Wed, 12 December 2007 10:55 He wanted a chat hook that made it cost a player 5000 credits to call in the airstrike. I made it for him. Here is a compiled version with source code: http://www.mp-gaming.com/reborn/coderelease/white.zip It really is only a cheap chat hook. I don't really recomend it tbh, my idea was to have the function called as some random event, or a power-up. Not based on credits. The chat hook can be used in team chat with !a10n and !a10g, both teams can use either one. He didn't ask for Nod to only use the Nod one and vise-versa, but really all you have to do to enable that is add to the conditional where I check for the credits the players has for there obj's team. Will try this out when I get home. I'll see what I can do with it. A crate may be good to do ~MathK1LL
MathK1LL wrote on Wed, 12 December 2007 18:59 reborn wrote on Wed, 12 December 2007 10:55 He wanted a chat hook that made it cost a player 5000 credits to call in the airstrike. I made it for him. Here is a compiled version with source code: http://www.mp-gaming.com/reborn/coderelease/white.zip It really is only a cheap chat hook. I don't really recomend it tbh, my idea was to have the function called as some random event, or a power-up. Not based on credits. The chat hook can be used in team chat with !a10n and !a10g, both teams can use either one. He didn't ask for Nod to only use the Nod one and vise-versa, but really all you have to do to enable that is add to the conditional where I check for the credits the players has for there obj's team. Will try this out when I get home. I'll see what I can do with it. A crate may be good to do ~MathK1LL the buildlog..error..
Why would you want a chat hook for that? It hits a building for 50% of its health, that basically means anyone with a lot of credits can decimate a building. And chat hooks are quite unoriginal.
reborn put it inside a chat hook for testing purposes. :\ ~MathK1LL
MathK1LL wrote on Fri, 14 December 2007 17:56 reborn put it inside a chat hook for testing purposes. :\ ~MathK1LL No, I believe he made it for wittebolx. I could be completely wrong though.
I made a chat hook for testing purposes, but then wittebolx asked me to make him a chat hook that he could use for gameplay purposes. I did actually say I didn't recomend it, frankly I agree. I hate all the nasty chat hooks. I intended for the functions to be "seemless", like a random event or a crate. Like it was supposed to be in the game or something, not some tacky chat hook.
I need a workaround for the looping. I played with many options, but none of them helped.
I think the looping is a boolean value at the end of the animation function. Set them all to a 0 and I think it should work...
I tried that (play animation 0 instead of 1) and the picture shows what happened on Walls_Flying and every other map I tested it=
They just stay there, but no loop? That makes sense I guess, it's just stuck on the last frame of the animation... They are all real objects, so you can destroy them. I can't remember from memory what the right syntax is, but it is most likely something simple like destroy_object; Or you could attach a script to it that destroys the object after x amount of time... void reb_timed_destroy::Created(GameObject *obj){ Commands->Start_Timer(obj,this,31.0f,1); } void reb_timed_destroy::Timer_Expired(GameObject *obj, int number){ if(number ==1){ Commands->Destroy_Object(obj); } } ScriptRegistrant<reb_timed_destroy> reb_timed_destroy_Registrant("reb_timed_destroy",""); class reb_timed_destroy : public ScriptImpClass { void Created(GameObject *obj); void Timer_Expired(GameObject *obj,int number); }; Just change the float value 31.0f to however many seconds you want it to wait until it destroys the object it is attached to.
why cant i get it i think i put the codes in the right places.....unless someone cant tell me? but this is what i get 1>.\gmscripts.cpp(68) : error C3861: 'Get_Random_Building': identifier not found 1>.\gmscripts.cpp(128) : error C3861: 'Get_Random_Building': identifier not found 1>.\gmscripts.cpp(1506) : error C2448: 'GDIreChatCommandReg' : function-style initializer appears to be a function definition but like i said i not sure what file to put them in but ya im also confussed on this and all the other codes everyone release here...wat files to put the code in
SSnipe wrote on Mon, 12 May 2008 20:52 why cant i get it i think i put the codes in the right places 1>.\gmscripts.cpp(68) : error C3861: 'Get_Random_Building': identifier not found ...wat files to put the code in The Random_Building is an addition to SSGM and has to be put in this way: engine_gm.cpp GameObject * Get_Random_Building(int Team) { std::vector<GameObject*> Buildings; GenericSLNode *x = BuildingGameObjList->HeadNode; while (x != 0) { GameObject *obj = (GameObject *)x->NodeData; if (obj && (Get_Object_Type(obj) == Team || Team == 2) && !Is_Building_Dead(obj)) { Buildings.push_back(obj); } x = x->NodeNext; } if (!Buildings.empty()) { int Rand = Commands->Get_Random_Int(0,Buildings.size()); return Buildings[Rand]; } return 0; } This comes right after "GameObject *Find_My_Veh" --------- To get it working, you have to put the following into engine_gm.h GameObject *Get_Random_Building(int Team); // Selects a random building which has to be alive This goes under "GameObject *Find_My_Veh(GameObject *obj); //Find my vehicle" ---------------- Generally, scripts should go into the gmmain.cpp, their classes into gmmain.h, ScriptRegistrants into gmmain.cpp OR gmcrate.cpp (does work even if it isn't a crate event). Chat hooks are in the gmmain.cpp, their Scriptregistrants can be put either in gmmain.cpp OR gmcrate.cpp. ========== Reborn thanks for the script, I'll check it later.