Command and Conquer: Renegade Official Forums - RDF feed
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Does anybody know of any veteran plugins with the soruce? Thanks in advance.
The was a link to one spammed all over these forums, but it was removed. I don't know why. Possibly becuase the source code wasn't included. I never got around to making mine a plug-in, but your welcome to the source code for it.
Really? Thanks a million, I havn't seen you on irc in a while though...
im surprised some 1 would release there Veteran system. theres like 3 or more going around in ren but people don't like sharing.
Yeah well certain people like checking a gifted horses mouth. -Ghost-
Gen_Blacky wrote on Sun, 02 December 2007 14:19 im surprised some 1 would release there Veteran system. theres like 3 or more going around in ren but people don't like sharing. //****************************************************************************** //******************************* VETERAN STUFF ******************************** struct VeteranPlayers { std::string PlayerName; int VeteranPoints; }; std::vector<VeteranPlayers> VetInfo; void VetUpdate(int ID, int number, int score) { if (!VetInfo.empty()) { for (int i = 0; i < VetInfo.size(); i++) { if (VetInfo[i].PlayerName == Get_Player_Name_By_ID(ID)) { int cvp, now; cvp = VetInfo[i].VeteranPoints; now = number + cvp; VetInfo[i].VeteranPoints = now; int Team; Team = Get_Team(ID); if (cvp < 100 && now >= 100) { char Promote[255]; sprintf(Promote,"msg Veteran: %s just got promoted to the rank of General", Get_Player_Name_By_ID(ID)); Console_Input(Promote); if (Team == 0) { sprintf(Promote, "ppage %d Kane has recognised your vision, you have been promoted to General, enjoy the extra 45HP armor on all NEW characters", ID); Commands->Create_2D_WAV_Sound("bonus_complete.wav"); } else { sprintf(Promote, "ppage %d Locke himself has promoted you to a General, enjoy the extra 45HP armor on all NEW characters", ID); Commands->Create_2D_WAV_Sound("bonus_complete.wav"); } Console_Input(Promote); } else if (cvp < 60 && now >= 60) { char Promote[255]; sprintf(Promote,"msg Veteran: %s just got promoted to the rank of Brigadier", Get_Player_Name_By_ID(ID)); Console_Input(Promote); if (Team == 0) { sprintf(Promote, "ppage %d The Brotherhood of Nod likes your style, you are promoted to rank Brigadier, enjoy the extra 30HP armor on all NEW characters", ID); Commands->Create_2D_WAV_Sound("m00bgwf_kill0031i1nbrs_snd.wav"); } else { sprintf(Promote, "ppage %d Keep em coming! you done all that left handed? You are promoted to Brigadier, enjoy the extra 30HP armor on all NEW characters", ID); Commands->Create_2D_WAV_Sound("m00achk_kill0034i1gbmg_snd.wav"); } Console_Input(Promote); } else if (cvp < 30 && now >= 30) { char Promote[255]; sprintf(Promote,"msg Veteran: %s just got promoted to the rank of Major, he gets an extra 15HP armor on every character he now buys", Get_Player_Name_By_ID(ID)); Console_Input(Promote); if (Team == 0) { sprintf(Promote, "ppage %d Kane wants you in his elite, you are promoted to Major, enjoy the splendors of war brother as every NEW character you buy will have an extra 15HP armor", ID); Commands->Create_2D_WAV_Sound("m00avis_kick0041i1nsmg_snd.wav"); } else { sprintf(Promote, "ppage %d The deadsix needs people like you, you are promoted to Major! Every NEW character from now on will have an extra 15HP armor", ID); Commands->Create_2D_WAV_Sound("m00_wins0003eval_snd.wav"); } Console_Input(Promote); } break; } } } } int VetCheckPoints(int ID) { if (!VetInfo.empty()) { for (int i = 0; i < VetInfo.size(); i++) { if (VetInfo[i].PlayerName == Get_Player_Name_By_ID(ID)) { int Points; Points = VetInfo[i].VeteranPoints; return Points; } } } return 0; } bool VetCheck(int ID) { if (!VetInfo.empty()) { for (int i = 0; i < VetInfo.size(); i++) { if (VetInfo[i].PlayerName == Get_Player_Name_By_ID(ID)) { return true; } } } return false; } void VetAddPlayer(int ID) { if (VetCheck(ID) == false) { VeteranPlayers temp; temp.PlayerName = Get_Player_Name_By_ID(ID); temp.VeteranPoints = 0; VetInfo.push_back(temp); } } void VetClearPlayers() { VetInfo.erase(VetInfo.begin(), VetInfo.end()); int Players = The_Game()->MaxPlayers; for (int i = 1; i <= Players; i++) { if (Get_GameObj(i)) { VetAddPlayer(i); } } } void reb_vet_System::Created(GameObject *obj) { int Points; Points = VetCheckPoints(Get_Player_ID(obj)); if (Points >= 100) { Level = 3; GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str()); IconID = Commands->Get_ID(Icon); Commands->Set_Model(Icon, "p_keycrd_red"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); Set_Max_Shield_Strength(obj, 145); Commands->Set_Shield_Strength(obj, 145); Commands->Start_Timer(obj, this, 2.0f, 3); } else if (Points >= 60) { Level = 2; GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str()); Commands->Set_Model(Icon, "p_keycrd_yel"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); IconID = Commands->Get_ID(Icon); Set_Max_Shield_Strength(obj, 130); Commands->Set_Shield_Strength(obj, 130); } else if (Points >= 30) { Level = 1; GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str()); Commands->Set_Model(Icon, "p_keycrd_grn"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); IconID = Commands->Get_ID(Icon); if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_FlameThrower_2SF")){ } Set_Max_Shield_Strength(obj, 115); Commands->Set_Shield_Strength(obj, 115); } else { Level = 0; } Commands->Start_Timer(obj, this, 60.0f, 10); } void reb_vet_System::Custom(GameObject *obj, int message, int param, GameObject *sender) { if (message == CUSTOM_EVENT_VEHICLE_ENTER) { Commands->Destroy_Object(Commands->Find_Object(IconID)); } else if (Level == 3) { GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str()); Commands->Set_Model(Icon, "p_keycrd_red"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); IconID = Commands->Get_ID(Icon); float Shield; Shield = Commands->Get_Shield_Strength(obj); Set_Max_Shield_Strength(obj, 145); Commands->Set_Shield_Strength(obj, Shield); } else if (Level == 2) { GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str()); Commands->Set_Model(Icon, "p_keycrd_yel"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); IconID = Commands->Get_ID(Icon); float Shield; Shield = Commands->Get_Shield_Strength(obj); Set_Max_Shield_Strength(obj, 130); Commands->Set_Shield_Strength(obj, Shield); } else if (Level == 1) { GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str()); IconID = Commands->Get_ID(Icon); Commands->Set_Model(Icon, "p_keycrd_grn"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_FlameThrower_2SF")){ } float Shield; Shield = Commands->Get_Shield_Strength(obj); Set_Max_Shield_Strength(obj, 115); Commands->Set_Shield_Strength(obj, Shield); } Commands->Start_Timer(obj, this, 60.0f, 10); } void reb_vet_System::Timer_Expired(GameObject *obj, int number) { /* if (number == 3) { Commands->Apply_Damage(obj, -1.0f, "Repair", false); Commands->Start_Timer(obj, this, 2.0f, 5); } else if (number == 10) { int Points; Points = VetCheckPoints(Get_Player_ID(obj)); if (Points >= 100 && Level < 3) { Level = 3; if (Get_Vehicle(obj) == 0) { Commands->Destroy_Object(Commands->Find_Object(ID)); GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Set_Model(Icon, "p_keycrd_red"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); ID = Commands->Get_ID(Icon); } Commands->Start_Timer(obj, this, 2.0f, 3); } else if (Points >= 60 && Level < 2) { Level = 2; if (Get_Vehicle(obj) == 0) { Commands->Destroy_Object(Commands->Find_Object(ID)); GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Set_Model(Icon, "p_keycrd_yel"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); ID = Commands->Get_ID(Icon); } } else if (Points >= 30 && Level < 1) { Level = 1; if (Get_Vehicle(obj) == 0) { Commands->Destroy_Object(Commands->Find_Object(ID)); GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Set_Model(Icon, "p_keycrd_grn"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); ID = Commands->Get_ID(Icon); } } Commands->Start_Timer(obj, this, 60.0f, 10); } */ } void reb_vet_System::Killed(GameObject *obj, GameObject *shooter) { Destroy_Script(); } void reb_vet_System::Destroyed(GameObject *obj) { Commands->Destroy_Object(Commands->Find_Object(IconID)); Destroy_Script(); } void reb_vet_System_Vehicles::Custom(GameObject *obj, int message, int param, GameObject *sender) { if (message == CUSTOM_EVENT_VEHICLE_ENTER) { int Points; Points = VetCheckPoints(Get_Player_ID(sender)); if (Points >= 100) { Level = 3; IsPoweredUp = true; if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) { //nothing } else { Commands->Start_Timer(obj, this, 1.0f, 3); } } else if (Points >= 60) { Level = 2; IsPoweredUp = true; if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) { //nothing Commands->Start_Timer(obj, this, 1.0f, 2); } else { Commands->Start_Timer(obj, this, 1.0f, 3); } } else if (Points >= 30) { Level = 1; IsPoweredUp = true; if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) { //nothing } else { Commands->Start_Timer(obj, this, 1.0f, 1); } } Commands->Send_Custom_Event(sender, sender, CUSTOM_EVENT_VEHICLE_ENTER, 0, 0); } else if (message == CUSTOM_EVENT_VEHICLE_EXIT) { if (IsPoweredUp == true) { IsPoweredUp = false; if (Level == 1) { if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) { //nothing } } else if (Level == 2) { if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) { //nothing } } else if (Level == 3) { if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) { //nothing } } } Commands->Send_Custom_Event(sender, sender, CUSTOM_EVENT_VEHICLE_EXIT, 0, 0); } } void reb_vet_System_Vehicles::Timer_Expired(GameObject *obj, int number) { if (number == 3 && IsPoweredUp == true) { Commands->Destroy_Object(Commands->Find_Object(ID)); Commands->Apply_Damage(obj, -3.0f, "Repair", false); Commands->Start_Timer(obj, this, 1.0f, 3); } else if (number == 2 && IsPoweredUp == true) { float Health, MaxHealth; Health = Commands->Get_Health(obj); MaxHealth = Commands->Get_Max_Health(obj); if (Health == MaxHealth) { // Nothing } else if (Health >= MaxHealth - 2) { Commands->Set_Health(obj, MaxHealth); } else if (Health <= MaxHealth - 3) { Commands->Set_Health(obj, Health + 3); } Commands->Start_Timer(obj, this, 1.0f, 2); } else if (number == 1 && IsPoweredUp == true) { float Shield, MaxShield; Shield = Commands->Get_Shield_Strength(obj); MaxShield = Commands->Get_Max_Shield_Strength(obj); if (Shield == MaxShield) { // Nothing } else if (Shield >= MaxShield - 2) { Commands->Set_Shield_Strength(obj, MaxShield); } else if (Shield <= MaxShield - 3) { Commands->Set_Shield_Strength(obj, Shield + 3); } Commands->Start_Timer(obj, this, 1.0f, 1); } } void reb_vet_System_Vehicles::Killed(GameObject *obj, GameObject *shooter) { Commands->Destroy_Object(Commands->Find_Object(ID)); Destroy_Script(); } void reb_vet_System_Vehicles::Destroyed(GameObject *obj) { Commands->Destroy_Object(Commands->Find_Object(ID)); Destroy_Script(); } void Player_Join_Hook(int i,const char *Nick) { VetAddPlayer(i); if (!Data->Plugins.empty()) { std::vector<PluginInfo*>::const_iterator it; for (it = Data->Plugins.begin();it != Data->Plugins.end(); ++it) { if ((*it)->Type == Plugin) { if ((*it)->PlayerJoinHookHandle) { (*it)->PlayerJoinHookHandle(i,Nick); } } } } if (Settings->GameMode == 2) { CTF_Player_Join(i); } } void GameOver() { VetClearPlayers(); char ObjectsType[10],ObjectsType2[10],ObjectsFile[20]; // rest of game over code from ssgm here, just didnt paste it to spam ScriptRegistrant<reb_vet_System> reb_vet_System_Registrant("reb_vet_System",""); ScriptRegistrant<reb_vet_System_Vehicles> reb_vet_System_Vehicles_Registrant("reb_vet_System_Vehicles",""); class vetChatCommand : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); if (!VetInfo.empty()) { for (int i = 0; i < VetInfo.size(); i++) { if (VetInfo[i].PlayerName == Get_Player_Name_By_ID(ID)) { int vetp; float score; vetp = VetInfo[i].VeteranPoints; score = Commands->Get_Points(Get_GameObj(ID)); char Vet[255]; if (vetp >= 100) { sprintf(Vet, "ppage %d Veteran Info for %s - Veteran Rank: General", ID, Get_Player_Name_By_ID(ID)); } else if (vetp >= 60) { sprintf(Vet, "ppage %d Veteran Info for %s - Veteran Points %d/100 - Veteran Rank: Brigadier", ID, Get_Player_Name_By_ID(ID), vetp); } else if (vetp >= 30) { sprintf(Vet, "ppage %d Veteran Info for %s - Veteran Points %d/60 - Veteran Rank: Major", ID, Get_Player_Name_By_ID(ID), vetp); } else { sprintf(Vet, "ppage %d Veteran Info for %s - Veteran Points %d/30 - Veteran Rank: Private", ID, Get_Player_Name_By_ID(ID), vetp); } Console_Input(Vet); break; } } } } }; ChatCommandRegistrant<vetChatCommand> vetChatCommandReg("!vet",CHATTYPE_TEAM,0,GAMEMODE_AOW); class reb_vet_System : public ScriptImpClass { void Created(GameObject *obj); void Custom(GameObject *obj, int message, int param, GameObject *sender); void Timer_Expired(GameObject *obj, int number); void Killed(GameObject *obj, GameObject *shooter); void Destroyed(GameObject *obj); int Level; int IconID; }; class reb_vet_System_Vehicles : public ScriptImpClass { void Custom(GameObject *obj, int message, int param, GameObject *sender); void Timer_Expired(GameObject *obj, int number); void Killed(GameObject *obj, GameObject *shooter); void Destroyed(GameObject *obj); int Level; int ID; bool IsPoweredUp; }; void MDB_SSGM_Building::Killed(GameObject *obj, GameObject *shooter) { if (Commands->Is_A_Star(shooter)){ VetUpdate(Get_Player_ID(shooter), 25, Commands->Get_Points(shooter)); } if (Commands->Get_ID(shooter) != 0) { if (Settings->LogBuildingKills) { GameObject *Preset = GetExplosionObj(); if (!Preset) { Preset = shooter; } FDSMessage(StrFormat("%s destroyed thanks to %ls (%s)",Translate_Preset(obj).c_str(),Get_Wide_Player_Name(shooter),Get_Preset_Info(Preset).c_str()),"_BUILDING"); } if (Settings->BuildingDeathRewardPage) { Console_Input(StrFormat("ppage %d The %s has been destroyed thanks to you!",Get_Player_ID(shooter),Translate_Preset(obj).c_str()).c_str()); } if (Settings->GameMode == 1) { Commands->Set_Is_Visible(shooter,true); } } IsAlive = false; if (Get_Building_Count_Team(Get_Object_Type(obj)) == 0) { BaseControllerClass::Find_Base(Get_Object_Type(obj))->Destroy_Base(); } } void MDB_SSGM_Player::Killed(GameObject *obj, GameObject *shooter) { if (Commands->Is_A_Star(shooter) && Commands->Get_Player_Type(shooter) != Commands->Get_Player_Type(obj)) { VetUpdate(Get_Player_ID(shooter), GetPoints(Commands->Get_Preset_Name(obj)), Commands->Get_Points(shooter)); } WasKilled = true; if (Find_My_Veh(obj)) { Commands->Send_Custom_Event(obj,Find_My_Veh(obj),1111,0,0); Console_Input(StrFormat("ppage %d Your vehicle has been unbound because you died.",Get_Player_ID(obj)).c_str()); } if (Settings->ExtraKillMessages) { if (Commands->Get_ID(shooter) == 0) { Send_Message_With_Team_Color(Get_Object_Type(obj),StrFormat("%ls was killed",Get_Wide_Player_Name(obj)).c_str()); } else if (Commands->Get_ID(obj) == Commands->Get_ID(shooter)) { Send_Message_With_Team_Color(Get_Object_Type(obj),StrFormat("%ls killed theirself",Get_Wide_Player_Name(obj)).c_str()); } else if (!Commands->Is_A_Star(shooter)) { Send_Message_With_Team_Color(Get_Object_Type(shooter),StrFormat("The %s killed %ls",Translate_Preset(shooter).c_str(),Get_Wide_Player_Name(obj)).c_str()); } } if (Settings->LogPlayerKills) { GameObject *ExpObj = GetExplosionObj(); GameObject *Preset = ExpObj; if (!Preset) { Preset = shooter; } if (Commands->Get_ID(shooter) == 0) { FDSMessage(StrFormat("%ls was killed (%s)",Get_Wide_Player_Name(obj),Get_Preset_Info(obj).c_str()),"_PLAYERKILL"); } else if (Commands->Get_ID(obj) == Commands->Get_ID(shooter)) { FDSMessage(StrFormat("%ls killed theirself (%s)",Get_Wide_Player_Name(obj),Get_Preset_Info(Preset).c_str()),"_PLAYERKILL"); } else if (!Commands->Is_A_Star(shooter)) { FDSMessage(StrFormat("The %s killed %ls (%s)",Translate_Preset(shooter).c_str(),Get_Wide_Player_Name(obj),Get_Preset_Info(obj).c_str()),"_PLAYERKILL"); } else { std::string killer = Get_String_Player_Name(shooter), killed = Get_String_Player_Name(obj), killerpreset = Get_Preset_Info(Preset), killedpreset = Get_Preset_Info(obj); if (Get_Vehicle(shooter) && !ExpObj) { std::string KillMsg = Settings->VvSKillMsg[Commands->Get_Random_Int(0,Settings->VvSKillMsg.size())]; StrReplace(KillMsg,"<killer>",killer); StrReplace(KillMsg,"<killed>",killed); StrReplace(KillMsg,"<killerpreset>",killerpreset); StrReplace(KillMsg,"<killedpreset>",killedpreset); FDSMessage(KillMsg,"_PLAYERKILL"); } else { std::string KillMsg = Settings->SvSKillMsg[Commands->Get_Random_Int(0,Settings->SvSKillMsg.size())]; StrReplace(KillMsg,"<killer>",killer); StrReplace(KillMsg,"<killed>",killed); StrReplace(KillMsg,"<killerpreset>",killerpreset); StrReplace(KillMsg,"<killedpreset>",killedpreset); FDSMessage(KillMsg,"_PLAYERKILL"); } } } } void MDB_SSGM_Vehicle::Killed(GameObject *obj, GameObject *shooter) { if (Commands->Is_A_Star(shooter)){ VetUpdate(Get_Player_ID(shooter), GetPoints(Commands->Get_Preset_Name(obj)), Commands->Get_Points(shooter)); } if (Settings->LogVehicleKills) { GameObject *Preset = GetExplosionObj(); if (!Preset) { //rest of mdb_ssgm_vehicle::Killed goes here Slipping in the veteran update as you can see is easy, so if you use other versions of ssgm or ssaow then you can easily apply the vetupdate function. That is partially finished, I wanted to make the veteran points dynamic for buildings, rather then a stock 25 points. I would of done this with getting the player_count, but I have had no time. The known issue is the SBH and stank getting the keycard attached to them too, which obviously you don't want. You could make a quick solution to this by not attaching the keycards as visual indicators of veterancy at all. But that isn't preferred. Also, the vehichle veterancy is incomplete, but it is started for you. You just have to add your power-ups to them. You may also want to add repairing veterancy too. But you're right Gen, most people that have the ability to share there stuff don't. Or they don't release source code. It is a shame. Are they afraid they will be ridiculed about there code? I know mine is sloppy as hell. I make errors all the time. There are bound to be people who make fun of it or say it is shit, but fuck em.. We all have to learn. I've just started a colledge course for my MCSD, so ofcourse I will get better. I won't make so many mistakes in the future and I will look back at code like this and most likely cringe. But we all have to start somewhere. Start sharing more fuckers.
Just something you should worry about, but otherwise it's good. Get_Player_Name Get_Player_Name_By_ID Get_Wide_Player_Name Get_Wide_Player_Name_By_ID WideCharToChar CharToWideChar need to be (delete [])-ed const char *pName = Get_Player_Name_By_ID(10); if(pName) { //use delete []pName; }
Gen_Blacky wrote on Sun, 02 December 2007 14:19 im surprised some 1 would release there Veteran system. theres like 3 or more going around in ren but people don't like sharing. People do share, but some get annoyed when others demand the source be released
Thanks mate
RoShamBo wrote on Mon, 03 December 2007 15:11 Just something you should worry about, but otherwise it's good. Get_Player_Name Get_Player_Name_By_ID Get_Wide_Player_Name Get_Wide_Player_Name_By_ID WideCharToChar CharToWideChar need to be (delete [])-ed const char *pName = Get_Player_Name_By_ID(10); if(pName) { //use delete []pName; } Just call roshambo the plumber from now on. Hex wrote on Mon, 03 December 2007 15:30 Gen_Blacky wrote on Sun, 02 December 2007 14:19 im surprised some 1 would release there Veteran system. theres like 3 or more going around in ren but people don't like sharing. People do share, but some get annoyed when others demand the source be released Well, I really don't see the point in with-holding it. Sure, someone might change some stuff, they might add a blue medal instead of a green one. Or they might make it some crazy extreme veteran system. They might change it drastically and call it there own. Someone might spot some leaky ass code and post it right after you post your source. Who cares? People will learn from your code, they might see something and it just clicks. Oh that's why it has it's own separate function, it's called in three different places, so you re-use that code. Or whatever... The worst that's gonna happen is it doesn't really work that well, people rip it off, or people laugh at your crappy code. The best that could happen is a bunch of players enjoy the system, and some eager server owners gets interested or learns from your code. He might be able to make some improvements... Look at SSGM, i'm pretty sure if it wasn't for vloktboky then we wouldn't have that right now. But it's only because Whitedragon carried it on that it is what it is today. Yet allot people on this forum wont of even heard of him. Don't let your own ego get in the way. It's the hardest thing to let go of in life.
When you post the source code to your program people will look at it and tell you how to improve it. Insults or not, you're learning from them. Someone calling you a "noob" at renegade is no different from when another programmer calls another programmer a "noob". Do you listen to other people in renegade? Why should you in anything else?
Hex wrote on Mon, 03 December 2007 14:30 Gen_Blacky wrote on Sun, 02 December 2007 14:19 im surprised some 1 would release there Veteran system. theres like 3 or more going around in ren but people don't like sharing. People do share, but some get annoyed when others demand the source be released yes that is true reborn wrote on Mon, 03 December 2007 10:55 Gen_Blacky wrote on Sun, 02 December 2007 14:19 im surprised some 1 would release there Veteran system. theres like 3 or more going around in ren but people don't like sharing. //****************************************************************************** //******************************* VETERAN STUFF ******************************** struct VeteranPlayers { std::string PlayerName; int VeteranPoints; }; std::vector<VeteranPlayers> VetInfo; void VetUpdate(int ID, int number, int score) { if (!VetInfo.empty()) { for (int i = 0; i < VetInfo.size(); i++) { if (VetInfo[i].PlayerName == Get_Player_Name_By_ID(ID)) { int cvp, now; cvp = VetInfo[i].VeteranPoints; now = number + cvp; VetInfo[i].VeteranPoints = now; int Team; Team = Get_Team(ID); if (cvp < 100 && now >= 100) { char Promote[255]; sprintf(Promote,"msg Veteran: %s just got promoted to the rank of General", Get_Player_Name_By_ID(ID)); Console_Input(Promote); if (Team == 0) { sprintf(Promote, "ppage %d Kane has recognised your vision, you have been promoted to General, enjoy the extra 45HP armor on all NEW characters", ID); Commands->Create_2D_WAV_Sound("bonus_complete.wav"); } else { sprintf(Promote, "ppage %d Locke himself has promoted you to a General, enjoy the extra 45HP armor on all NEW characters", ID); Commands->Create_2D_WAV_Sound("bonus_complete.wav"); } Console_Input(Promote); } else if (cvp < 60 && now >= 60) { char Promote[255]; sprintf(Promote,"msg Veteran: %s just got promoted to the rank of Brigadier", Get_Player_Name_By_ID(ID)); Console_Input(Promote); if (Team == 0) { sprintf(Promote, "ppage %d The Brotherhood of Nod likes your style, you are promoted to rank Brigadier, enjoy the extra 30HP armor on all NEW characters", ID); Commands->Create_2D_WAV_Sound("m00bgwf_kill0031i1nbrs_snd.wav"); } else { sprintf(Promote, "ppage %d Keep em coming! you done all that left handed? You are promoted to Brigadier, enjoy the extra 30HP armor on all NEW characters", ID); Commands->Create_2D_WAV_Sound("m00achk_kill0034i1gbmg_snd.wav"); } Console_Input(Promote); } else if (cvp < 30 && now >= 30) { char Promote[255]; sprintf(Promote,"msg Veteran: %s just got promoted to the rank of Major, he gets an extra 15HP armor on every character he now buys", Get_Player_Name_By_ID(ID)); Console_Input(Promote); if (Team == 0) { sprintf(Promote, "ppage %d Kane wants you in his elite, you are promoted to Major, enjoy the splendors of war brother as every NEW character you buy will have an extra 15HP armor", ID); Commands->Create_2D_WAV_Sound("m00avis_kick0041i1nsmg_snd.wav"); } else { sprintf(Promote, "ppage %d The deadsix needs people like you, you are promoted to Major! Every NEW character from now on will have an extra 15HP armor", ID); Commands->Create_2D_WAV_Sound("m00_wins0003eval_snd.wav"); } Console_Input(Promote); } break; } } } } int VetCheckPoints(int ID) { if (!VetInfo.empty()) { for (int i = 0; i < VetInfo.size(); i++) { if (VetInfo[i].PlayerName == Get_Player_Name_By_ID(ID)) { int Points; Points = VetInfo[i].VeteranPoints; return Points; } } } return 0; } bool VetCheck(int ID) { if (!VetInfo.empty()) { for (int i = 0; i < VetInfo.size(); i++) { if (VetInfo[i].PlayerName == Get_Player_Name_By_ID(ID)) { return true; } } } return false; } void VetAddPlayer(int ID) { if (VetCheck(ID) == false) { VeteranPlayers temp; temp.PlayerName = Get_Player_Name_By_ID(ID); temp.VeteranPoints = 0; VetInfo.push_back(temp); } } void VetClearPlayers() { VetInfo.erase(VetInfo.begin(), VetInfo.end()); int Players = The_Game()->MaxPlayers; for (int i = 1; i <= Players; i++) { if (Get_GameObj(i)) { VetAddPlayer(i); } } } void reb_vet_System::Created(GameObject *obj) { int Points; Points = VetCheckPoints(Get_Player_ID(obj)); if (Points >= 100) { Level = 3; GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str()); IconID = Commands->Get_ID(Icon); Commands->Set_Model(Icon, "p_keycrd_red"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); Set_Max_Shield_Strength(obj, 145); Commands->Set_Shield_Strength(obj, 145); Commands->Start_Timer(obj, this, 2.0f, 3); } else if (Points >= 60) { Level = 2; GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str()); Commands->Set_Model(Icon, "p_keycrd_yel"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); IconID = Commands->Get_ID(Icon); Set_Max_Shield_Strength(obj, 130); Commands->Set_Shield_Strength(obj, 130); } else if (Points >= 30) { Level = 1; GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str()); Commands->Set_Model(Icon, "p_keycrd_grn"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); IconID = Commands->Get_ID(Icon); if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_FlameThrower_2SF")){ } Set_Max_Shield_Strength(obj, 115); Commands->Set_Shield_Strength(obj, 115); } else { Level = 0; } Commands->Start_Timer(obj, this, 60.0f, 10); } void reb_vet_System::Custom(GameObject *obj, int message, int param, GameObject *sender) { if (message == CUSTOM_EVENT_VEHICLE_ENTER) { Commands->Destroy_Object(Commands->Find_Object(IconID)); } else if (Level == 3) { GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str()); Commands->Set_Model(Icon, "p_keycrd_red"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); IconID = Commands->Get_ID(Icon); float Shield; Shield = Commands->Get_Shield_Strength(obj); Set_Max_Shield_Strength(obj, 145); Commands->Set_Shield_Strength(obj, Shield); } else if (Level == 2) { GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str()); Commands->Set_Model(Icon, "p_keycrd_yel"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); IconID = Commands->Get_ID(Icon); float Shield; Shield = Commands->Get_Shield_Strength(obj); Set_Max_Shield_Strength(obj, 130); Commands->Set_Shield_Strength(obj, Shield); } else if (Level == 1) { GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str()); IconID = Commands->Get_ID(Icon); Commands->Set_Model(Icon, "p_keycrd_grn"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_FlameThrower_2SF")){ } float Shield; Shield = Commands->Get_Shield_Strength(obj); Set_Max_Shield_Strength(obj, 115); Commands->Set_Shield_Strength(obj, Shield); } Commands->Start_Timer(obj, this, 60.0f, 10); } void reb_vet_System::Timer_Expired(GameObject *obj, int number) { /* if (number == 3) { Commands->Apply_Damage(obj, -1.0f, "Repair", false); Commands->Start_Timer(obj, this, 2.0f, 5); } else if (number == 10) { int Points; Points = VetCheckPoints(Get_Player_ID(obj)); if (Points >= 100 && Level < 3) { Level = 3; if (Get_Vehicle(obj) == 0) { Commands->Destroy_Object(Commands->Find_Object(ID)); GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Set_Model(Icon, "p_keycrd_red"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); ID = Commands->Get_ID(Icon); } Commands->Start_Timer(obj, this, 2.0f, 3); } else if (Points >= 60 && Level < 2) { Level = 2; if (Get_Vehicle(obj) == 0) { Commands->Destroy_Object(Commands->Find_Object(ID)); GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Set_Model(Icon, "p_keycrd_yel"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); ID = Commands->Get_ID(Icon); } } else if (Points >= 30 && Level < 1) { Level = 1; if (Get_Vehicle(obj) == 0) { Commands->Destroy_Object(Commands->Find_Object(ID)); GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Set_Model(Icon, "p_keycrd_grn"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); ID = Commands->Get_ID(Icon); } } Commands->Start_Timer(obj, this, 60.0f, 10); } */ } void reb_vet_System::Killed(GameObject *obj, GameObject *shooter) { Destroy_Script(); } void reb_vet_System::Destroyed(GameObject *obj) { Commands->Destroy_Object(Commands->Find_Object(IconID)); Destroy_Script(); } void reb_vet_System_Vehicles::Custom(GameObject *obj, int message, int param, GameObject *sender) { if (message == CUSTOM_EVENT_VEHICLE_ENTER) { int Points; Points = VetCheckPoints(Get_Player_ID(sender)); if (Points >= 100) { Level = 3; IsPoweredUp = true; if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) { //nothing } else { Commands->Start_Timer(obj, this, 1.0f, 3); } } else if (Points >= 60) { Level = 2; IsPoweredUp = true; if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) { //nothing Commands->Start_Timer(obj, this, 1.0f, 2); } else { Commands->Start_Timer(obj, this, 1.0f, 3); } } else if (Points >= 30) { Level = 1; IsPoweredUp = true; if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) { //nothing } else { Commands->Start_Timer(obj, this, 1.0f, 1); } } Commands->Send_Custom_Event(sender, sender, CUSTOM_EVENT_VEHICLE_ENTER, 0, 0); } else if (message == CUSTOM_EVENT_VEHICLE_EXIT) { if (IsPoweredUp == true) { IsPoweredUp = false; if (Level == 1) { if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) { //nothing } } else if (Level == 2) { if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) { //nothing } } else if (Level == 3) { if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) { //nothing } } } Commands->Send_Custom_Event(sender, sender, CUSTOM_EVENT_VEHICLE_EXIT, 0, 0); } } void reb_vet_System_Vehicles::Timer_Expired(GameObject *obj, int number) { if (number == 3 && IsPoweredUp == true) { Commands->Destroy_Object(Commands->Find_Object(ID)); Commands->Apply_Damage(obj, -3.0f, "Repair", false); Commands->Start_Timer(obj, this, 1.0f, 3); } else if (number == 2 && IsPoweredUp == true) { float Health, MaxHealth; Health = Commands->Get_Health(obj); MaxHealth = Commands->Get_Max_Health(obj); if (Health == MaxHealth) { // Nothing } else if (Health >= MaxHealth - 2) { Commands->Set_Health(obj, MaxHealth); } else if (Health <= MaxHealth - 3) { Commands->Set_Health(obj, Health + 3); } Commands->Start_Timer(obj, this, 1.0f, 2); } else if (number == 1 && IsPoweredUp == true) { float Shield, MaxShield; Shield = Commands->Get_Shield_Strength(obj); MaxShield = Commands->Get_Max_Shield_Strength(obj); if (Shield == MaxShield) { // Nothing } else if (Shield >= MaxShield - 2) { Commands->Set_Shield_Strength(obj, MaxShield); } else if (Shield <= MaxShield - 3) { Commands->Set_Shield_Strength(obj, Shield + 3); } Commands->Start_Timer(obj, this, 1.0f, 1); } } void reb_vet_System_Vehicles::Killed(GameObject *obj, GameObject *shooter) { Commands->Destroy_Object(Commands->Find_Object(ID)); Destroy_Script(); } void reb_vet_System_Vehicles::Destroyed(GameObject *obj) { Commands->Destroy_Object(Commands->Find_Object(ID)); Destroy_Script(); } void Player_Join_Hook(int i,const char *Nick) { VetAddPlayer(i); if (!Data->Plugins.empty()) { std::vector<PluginInfo*>::const_iterator it; for (it = Data->Plugins.begin();it != Data->Plugins.end(); ++it) { if ((*it)->Type == Plugin) { if ((*it)->PlayerJoinHookHandle) { (*it)->PlayerJoinHookHandle(i,Nick); } } } } if (Settings->GameMode == 2) { CTF_Player_Join(i); } } void GameOver() { VetClearPlayers(); char ObjectsType[10],ObjectsType2[10],ObjectsFile[20]; // rest of game over code from ssgm here, just didnt paste it to spam ScriptRegistrant<reb_vet_System> reb_vet_System_Registrant("reb_vet_System",""); ScriptRegistrant<reb_vet_System_Vehicles> reb_vet_System_Vehicles_Registrant("reb_vet_System_Vehicles",""); class vetChatCommand : public ChatCommandClass { void Triggered(int ID,const TokenClass &Text,int ChatType) { GameObject *obj = Get_GameObj(ID); if (!VetInfo.empty()) { for (int i = 0; i < VetInfo.size(); i++) { if (VetInfo[i].PlayerName == Get_Player_Name_By_ID(ID)) { int vetp; float score; vetp = VetInfo[i].VeteranPoints; score = Commands->Get_Points(Get_GameObj(ID)); char Vet[255]; if (vetp >= 100) { sprintf(Vet, "ppage %d Veteran Info for %s - Veteran Rank: General", ID, Get_Player_Name_By_ID(ID)); } else if (vetp >= 60) { sprintf(Vet, "ppage %d Veteran Info for %s - Veteran Points %d/100 - Veteran Rank: Brigadier", ID, Get_Player_Name_By_ID(ID), vetp); } else if (vetp >= 30) { sprintf(Vet, "ppage %d Veteran Info for %s - Veteran Points %d/60 - Veteran Rank: Major", ID, Get_Player_Name_By_ID(ID), vetp); } else { sprintf(Vet, "ppage %d Veteran Info for %s - Veteran Points %d/30 - Veteran Rank: Private", ID, Get_Player_Name_By_ID(ID), vetp); } Console_Input(Vet); break; } } } } }; ChatCommandRegistrant<vetChatCommand> vetChatCommandReg("!vet",CHATTYPE_TEAM,0,GAMEMODE_AOW); class reb_vet_System : public ScriptImpClass { void Created(GameObject *obj); void Custom(GameObject *obj, int message, int param, GameObject *sender); void Timer_Expired(GameObject *obj, int number); void Killed(GameObject *obj, GameObject *shooter); void Destroyed(GameObject *obj); int Level; int IconID; }; class reb_vet_System_Vehicles : public ScriptImpClass { void Custom(GameObject *obj, int message, int param, GameObject *sender); void Timer_Expired(GameObject *obj, int number); void Killed(GameObject *obj, GameObject *shooter); void Destroyed(GameObject *obj); int Level; int ID; bool IsPoweredUp; }; void MDB_SSGM_Building::Killed(GameObject *obj, GameObject *shooter) { if (Commands->Is_A_Star(shooter)){ VetUpdate(Get_Player_ID(shooter), 25, Commands->Get_Points(shooter)); } if (Commands->Get_ID(shooter) != 0) { if (Settings->LogBuildingKills) { GameObject *Preset = GetExplosionObj(); if (!Preset) { Preset = shooter; } FDSMessage(StrFormat("%s destroyed thanks to %ls (%s)",Translate_Preset(obj).c_str(),Get_Wide_Player_Name(shooter),Get_Preset_Info(Preset).c_str()),"_BUILDING"); } if (Settings->BuildingDeathRewardPage) { Console_Input(StrFormat("ppage %d The %s has been destroyed thanks to you!",Get_Player_ID(shooter),Translate_Preset(obj).c_str()).c_str()); } if (Settings->GameMode == 1) { Commands->Set_Is_Visible(shooter,true); } } IsAlive = false; if (Get_Building_Count_Team(Get_Object_Type(obj)) == 0) { BaseControllerClass::Find_Base(Get_Object_Type(obj))->Destroy_Base(); } } void MDB_SSGM_Player::Killed(GameObject *obj, GameObject *shooter) { if (Commands->Is_A_Star(shooter) && Commands->Get_Player_Type(shooter) != Commands->Get_Player_Type(obj)) { VetUpdate(Get_Player_ID(shooter), GetPoints(Commands->Get_Preset_Name(obj)), Commands->Get_Points(shooter)); } WasKilled = true; if (Find_My_Veh(obj)) { Commands->Send_Custom_Event(obj,Find_My_Veh(obj),1111,0,0); Console_Input(StrFormat("ppage %d Your vehicle has been unbound because you died.",Get_Player_ID(obj)).c_str()); } if (Settings->ExtraKillMessages) { if (Commands->Get_ID(shooter) == 0) { Send_Message_With_Team_Color(Get_Object_Type(obj),StrFormat("%ls was killed",Get_Wide_Player_Name(obj)).c_str()); } else if (Commands->Get_ID(obj) == Commands->Get_ID(shooter)) { Send_Message_With_Team_Color(Get_Object_Type(obj),StrFormat("%ls killed theirself",Get_Wide_Player_Name(obj)).c_str()); } else if (!Commands->Is_A_Star(shooter)) { Send_Message_With_Team_Color(Get_Object_Type(shooter),StrFormat("The %s killed %ls",Translate_Preset(shooter).c_str(),Get_Wide_Player_Name(obj)).c_str()); } } if (Settings->LogPlayerKills) { GameObject *ExpObj = GetExplosionObj(); GameObject *Preset = ExpObj; if (!Preset) { Preset = shooter; } if (Commands->Get_ID(shooter) == 0) { FDSMessage(StrFormat("%ls was killed (%s)",Get_Wide_Player_Name(obj),Get_Preset_Info(obj).c_str()),"_PLAYERKILL"); } else if (Commands->Get_ID(obj) == Commands->Get_ID(shooter)) { FDSMessage(StrFormat("%ls killed theirself (%s)",Get_Wide_Player_Name(obj),Get_Preset_Info(Preset).c_str()),"_PLAYERKILL"); } else if (!Commands->Is_A_Star(shooter)) { FDSMessage(StrFormat("The %s killed %ls (%s)",Translate_Preset(shooter).c_str(),Get_Wide_Player_Name(obj),Get_Preset_Info(obj).c_str()),"_PLAYERKILL"); } else { std::string killer = Get_String_Player_Name(shooter), killed = Get_String_Player_Name(obj), killerpreset = Get_Preset_Info(Preset), killedpreset = Get_Preset_Info(obj); if (Get_Vehicle(shooter) && !ExpObj) { std::string KillMsg = Settings->VvSKillMsg[Commands->Get_Random_Int(0,Settings->VvSKillMsg.size())]; StrReplace(KillMsg,"<killer>",killer); StrReplace(KillMsg,"<killed>",killed); StrReplace(KillMsg,"<killerpreset>",killerpreset); StrReplace(KillMsg,"<killedpreset>",killedpreset); FDSMessage(KillMsg,"_PLAYERKILL"); } else { std::string KillMsg = Settings->SvSKillMsg[Commands->Get_Random_Int(0,Settings->SvSKillMsg.size())]; StrReplace(KillMsg,"<killer>",killer); StrReplace(KillMsg,"<killed>",killed); StrReplace(KillMsg,"<killerpreset>",killerpreset); StrReplace(KillMsg,"<killedpreset>",killedpreset); FDSMessage(KillMsg,"_PLAYERKILL"); } } } } void MDB_SSGM_Vehicle::Killed(GameObject *obj, GameObject *shooter) { if (Commands->Is_A_Star(shooter)){ VetUpdate(Get_Player_ID(shooter), GetPoints(Commands->Get_Preset_Name(obj)), Commands->Get_Points(shooter)); } if (Settings->LogVehicleKills) { GameObject *Preset = GetExplosionObj(); if (!Preset) { //rest of mdb_ssgm_vehicle::Killed goes here Slipping in the veteran update as you can see is easy, so if you use other versions of ssgm or ssaow then you can easily apply the vetupdate function. That is partially finished, I wanted to make the veteran points dynamic for buildings, rather then a stock 25 points. I would of done this with getting the player_count, but I have had no time. The known issue is the SBH and stank getting the keycard attached to them too, which obviously you don't want. You could make a quick solution to this by not attaching the keycards as visual indicators of veterancy at all. But that isn't preferred. Also, the vehichle veterancy is incomplete, but it is started for you. You just have to add your power-ups to them. You may also want to add repairing veterancy too. But you're right Gen, most people that have the ability to share there stuff don't. Or they don't release source code. It is a shame. Are they afraid they will be ridiculed about there code? I know mine is sloppy as hell. I make errors all the time. There are bound to be people who make fun of it or say it is shit, but fuck em.. We all have to learn. I've just started a colledge course for my MCSD, so ofcourse I will get better. I won't make so many mistakes in the future and I will look back at code like this and most likely cringe. But we all have to start somewhere. Start sharing more fuckers. its not really people getting ridiculed for code more that they don't want other servers to have it. Its great when people like you like to help other people out and share your work. I hope more people are willing to share there work. isn't that what the mod forums is for ? The servers that i help mod already has a veteran system because some 1 was nice enough to give it to us, so there still a lot of people who share. thx reborn
tbh, if someone came to me and asked for me to release it, I would have, but no that did not happen, instead what happened, 1 person said source plz and 2 other people did nothing but quote the first without adding anything to it and then they flame and have snipes at you because you never did what they wanted
Hex wrote on Tue, 04 December 2007 00:47 tbh, if someone came to me and asked for me to release it, I would have, but no that did not happen, instead what happened, 1 person said source plz and 2 other people did nothing but quote the first without adding anything to it and then they flame and have snipes at you because you never did what they wanted I've already explained what i meant by my comment, if that's aimed at me. If me and Reborn needed the source we probably would of asked you. We don't, though, since Reborn has written his own and I don't need it. We only wanted it out of interest, it's not worth pursuing. Me or Reborn may not of needed it, there are probably a lot of other people out there that would learn from your code and benefit from it.
Get_Wide_Player_Name_By_ID and Get_Wide_Player_Name do not need to be deleted. That's why they're used instead of the regular versions.
Yes, Get_Wide_Player_Name doesn't need to be deleted. const char *Get_Player_Name_By_ID(int PlayerID) { cPlayer *x = FindPlayer(PlayerID); if (!x) { return 0; } return WideCharToChar(x->PlayerName); } const char *WideCharToChar(const wchar_t *wcs) { if (!wcs) { char *c = new char[2]; c[0] = 0; c[1] = 0; return c; } int length = wcslen(wcs); char *text = new char[length+1]; wcstombs(text,wcs,length+1); return text; }
Dan, not at all dude, I know you're more than capible of creating something fr more advanced, as said on MSN, I was talking in general on that post
I can actually see why Hex doesn't release it. It's the same reason why I don't release a couple of my creations. You don't want someone to rip your work and call it their own without giving proper credits to the original creator. ~MathK1LL
Bah, what are they gonna do? Sell it for millions to EA? Pretty much every mod available today is only so because one guy released his stuff for the rest of us. You can keep the "renefame", I would much rather prefer a community that actually knew how to code and helped eachother. It would be awesome if I could make a post here with my problem and have it solved, or help on it. There is only about four or five people that I can actually talk to about coding and the renegade API and get a helpful answer. I would love for a community like farcry and crysis has.
The trouble is, C++ is hard
Speaking from pure experience, MathKill, I have found that sharing and supporting your work with those around you actually yields far more positive and rewarding results. It building character, respect, and it makes it very easy to network with others around you who share a similar passion. It opens doors. C++ isn't that hard. There is a bit of a learning curve to get over at first, with learning the syntax rules of the language. But working in this environment is more of a specialized scripting language over pure C++ programming. With everything you need in the backyard, there is no need for you to venture out into the rest of the neighborhood, so don't concern yourself with it.
Well, its not that its hard(nvm what i said ) its more.. Where do I start? I don't want to do boring console commands featuring then plain and dull "Hello World" , wow, i know c++, i can cout << things...
I'm not bothered about releasing code or people changing it, what annoys me is people that made snide comments because you don't. reborn wrote on Sat, 01 December 2007 06:55 The was a link to one spammed all over these forums Need I say more.
Just ignore those people, if someone makes an unconstructive, unhelpful post. Pretend it doesn't exist. If you know better yourself, why be put down by what someone else says? EDIT: @MathK1LL, if you found someone had ripped your code and passed it off as their own they will get found out, and quite easily. Then ridiculed by the community. Scrin? Matix? just some examples.
RoShamBo wrote on Tue, 04 December 2007 17:32 Just ignore those people, if someone makes an unconstructive, unhelpful post. Pretend it doesn't exist. If you know better yourself, why be put down by what someone else says? EDIT: @MathK1LL, if you found someone had ripped your code and passed it off as their own they will get found out, and quite easily. Then ridiculed by the community. Scrin? Matix? just some examples. So true. There's also the fact that Scrin is a cheater though, but Matix has DoSed people in the past so, yeah.
Hex wrote on Tue, 04 December 2007 17:43 I'm not bothered about releasing code or people changing it, what annoys me is people that made snide comments because you don't. reborn wrote on Sat, 01 December 2007 06:55 The was a link to one spammed all over these forums Need I say more. Well, I posted that after you removed the public links (or had them removed). Look, I think you have assumed me to be some self-rightous annoying butt-hole. I'm not trying to get on your tits. I believe that making your code available to everyone is a good thing. Seeing as how you've released the .dll I can't see the issue with releasing the source code. I don't want to make a big thing about it, and I don't want us to fall out over it. It's nice that you have released a plug-in for people to use. If you want to leave it at that then that's fine. You done a good thing. I believe you could do a better thing by releasing the source code too, but it's up to you. The plug-in you made seems to work great and I congratulate you on it. I would like to leave it on the note though that your plug-in would not exist today if it wasn't for someone else releasing there source. What you accomplished would not of been possible, or would of been allot harder, if it wasn't for someone else releasing there source code.
hey reborn about the vet system, i added your code and tried to compile it, but there were many errors. i got some help from roshambo with fixing some of the errors but at a moment roshambo said he needed the functions. i cant seem to find those? can you help on that? 1>gmmain.obj : error LNK2019: unresolved external symbol "bool __cdecl IsLowClassVehicle(char const *)" (?IsLowClassVehicle@@YA_NPBD@Z) referenced in function "private: virtual void __thiscall reb_vet_System_Vehicles::Custom(unsigned char *,int,int,unsigned char *)" (?Custom@reb_vet_System_Vehicles@@EAEXPAEHH0@Z) 1>gmscripts.obj : error LNK2019: unresolved external symbol "int __cdecl GetPoints(char const *)" (?GetPoints@@YAHPBD@Z) referenced in function "private: virtual void __thiscall MDB_SSGM_Player::Killed(unsigned char *,unsigned char *)" (?Killed@MDB_SSGM_Player@@EAEXPAE0@Z) 1>scripts.dll : fatal error LNK1120: 2 unresolved externals
IsLowClassVehicle GetPoints are missing
RoShamBo wrote on Wed, 02 January 2008 12:37 IsLowClassVehicle GetPoints are missing I forgot about those... int GetPoints(const char* Preset) { int VetWorth = 0; if (stricmp(Preset,"CnC_GDI_Engineer_0") == 0) VetWorth = 1; else if (stricmp(Preset,"CnC_GDI_Engineer_2SF") == 0) VetWorth = 3; else if (stricmp(Preset,"CnC_GDI_Grenadier_0") == 0) VetWorth = 1; else if (stricmp(Preset,"CnC_GDI_Grenadier_2SF") == 0) VetWorth = 2; else if (strstr(Preset,"CnC_Ignatio_Mobius")) VetWorth = 3; else if (stricmp(Preset,"CnC_GDI_MiniGunner_0") == 0) VetWorth = 1; else if (stricmp(Preset,"CnC_GDI_MiniGunner_1Off") == 0) VetWorth = 2; else if (stricmp(Preset,"CnC_GDI_MiniGunner_2SF") == 0) VetWorth = 2; else if (strstr(Preset,"CnC_GDI_MiniGunner_3Boss")) VetWorth = 3; else if (stricmp(Preset,"CnC_GDI_RocketSoldier_0") == 0) VetWorth = 1; else if (stricmp(Preset,"CnC_GDI_RocketSoldier_1Off") == 0) VetWorth = 2; else if (stricmp(Preset,"CnC_GDI_RocketSoldier_2SF") == 0) VetWorth = 2; else if (stricmp(Preset,"CnC_Nod_Engineer_0") == 0) VetWorth = 1; else if (stricmp(Preset,"CnC_Nod_FlameThrower_0") == 0) VetWorth = 1; else if (stricmp(Preset,"CnC_Nod_FlameThrower_1Off") == 0) VetWorth = 2; else if (stricmp(Preset,"CnC_Nod_FlameThrower_2SF") == 0) VetWorth = 2; else if (strstr(Preset,"CnC_Nod_FlameThrower_3Boss")) VetWorth = 3; else if (stricmp(Preset,"CnC_Nod_Minigunner_0") == 0) VetWorth = 1; else if (stricmp(Preset,"CnC_Nod_Minigunner_1Off") == 0) VetWorth = 2; else if (stricmp(Preset,"CnC_Nod_Minigunner_2SF") == 0) VetWorth = 2; else if (strstr(Preset,"CnC_Nod_Minigunner_3Boss")) VetWorth = 3; else if (strstr(Preset,"CnC_Nod_MiniGunner_3Boss")) VetWorth = 3; else if (stricmp(Preset,"CnC_Nod_RocketSoldier_0") == 0) VetWorth = 1; else if (stricmp(Preset,"CnC_Nod_RocketSoldier_1Off") == 0) VetWorth = 2; else if (stricmp(Preset,"CnC_Nod_RocketSoldier_2SF") == 0) VetWorth = 2; else if (strstr(Preset,"CnC_Nod_RocketSoldier_3Boss")) VetWorth = 3; else if (stricmp(Preset,"CnC_Nod_Technician_0") == 0) VetWorth = 3; else if (strstr(Preset,"CnC_Sydney_PowerSuit")) VetWorth = 3; else if (stricmp(Preset,"CnC_Sydney") == 0) VetWorth = 2; else if (strstr(Preset,"CnC_GDI_APC")) VetWorth = 3; else if (strstr(Preset,"CnC_GDI_Humm-vee")) VetWorth = 2; else if (strstr(Preset,"CnC_GDI_MRLS")) VetWorth = 3; else if (strstr(Preset,"CnC_Civilian_Pickup01_Secret")) VetWorth = 2; else if (strstr(Preset,"CnC_Civilian_Sedan01_Secret")) VetWorth = 2; else if (strstr(Preset,"CnC_Nod_APC")) VetWorth = 3; else if (strstr(Preset,"CnC_Nod_Buggy")) VetWorth = 2; else if (strstr(Preset,"CnC_Nod_Mobile Artillery")) VetWorth = 3; else if (strstr(Preset,"Nod_Chameleon")) VetWorth = 2; else if (strstr(Preset,"CnC_Nod_Recon_Bike")) VetWorth = 2; else if (strstr(Preset,"CnC_Nod_Transport")) VetWorth = 2; else if (strstr(Preset,"CnC_GDI_Transport")) VetWorth = 2; else if (strstr(Preset,"CnC_GDI_Medium_Tank")) VetWorth = 4; else if (strstr(Preset,"CnC_GDI_Mammoth_Tank")) VetWorth = 5; else if (strstr(Preset,"CnC_Nod_Light_Tank")) VetWorth = 4; else if (strstr(Preset,"CnC_Nod_Flame_Tank")) VetWorth = 4; else if (strstr(Preset,"CnC_Nod_Stealth_Tank")) VetWorth = 5; else if (strstr(Preset,"CnC_Nod_Apache")) VetWorth = 4; else if (strstr(Preset,"CnC_GDI_Orca")) VetWorth = 4; else if (strstr(Preset,"CnC_GDI_Harvester")) VetWorth = 2; else if (strstr(Preset,"CnC_Nod_Harvester")) VetWorth = 2; return VetWorth; } bool IsLowClassVehicle(const char *Preset) { if (strstr(Preset,"CnC_GDI_APC")) return true; else if (strstr(Preset,"CnC_GDI_Humm-vee")) return true; else if (strstr(Preset,"CnC_GDI_MRLS")) return true; else if (strstr(Preset,"CnC_Civilian_Pickup01_Secret")) return true; else if (strstr(Preset,"CnC_Civilian_Sedan01_Secret")) return true; else if (strstr(Preset,"CnC_Nod_APC")) return true; else if (strstr(Preset,"CnC_Nod_Buggy")) return true; else if (strstr(Preset,"CnC_Nod_Mobile Artillery")) return true; else if (strstr(Preset,"Nod_Chameleon")) return true; else if (strstr(Preset,"CnC_Nod_Recon_Bike")) return true; else if (strstr(Preset,"CnC_Nod_Transport")) return true; else if (strstr(Preset,"CnC_GDI_Transport")) return true; return false; }
Ah, there they are. Thanks Reborn.
No worries, can't unerstand how I over-looked including them to be honest.
THX Reborn. i got it compiled now and it works great!
it didnt work so well for me :S here is what it told me ever so violently ------ Build started: Project: SSGM, Configuration: Debug Win32 ------ Compiling... gmscripts.cpp .\gmscripts.cpp(46) : error C2220: warning treated as error - no 'object' file generated .\gmscripts.cpp(46) : warning C4018: '<' : signed/unsigned mismatch .\gmscripts.cpp(105) : warning C4018: '<' : signed/unsigned mismatch .\gmscripts.cpp(118) : warning C4018: '<' : signed/unsigned mismatch .\gmscripts.cpp(144) : error C2601: 'IsLowClassVehicle' : local function definitions are illegal .\gmscripts.cpp(136): this line contains a '{' which has not yet been matched .\gmscripts.cpp(144) : fatal error C1903: unable to recover from previous error(s); stopping compilation gmmain.cpp .\gmmain.cpp(812) : error C3861: 'VetAddPlayer': identifier not found .\gmmain.cpp(990) : error C3861: 'VetClearPlayers': identifier not found Generating Code... Creating browse information file... Microsoft Browse Information Maintenance Utility Version 8.00.50727 Copyright (C) Microsoft Corporation. All rights reserved. BSCMAKE: error BK1506 : cannot open file '.\tmp\scripts\debug\gmscripts.sbr': No such file or directory Build log was saved at "file://f:\DarkWorld C&C C++\SSGM Source\tmp\scripts\debug\BuildLog.htm" SSGM - 6 error(s), 3 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
#pragma warning(disable: 4996) I'd need to see the code to fix the other errors.
i have this at the top of gmscripts.cpp /* Renegade Scripts.dll SSGM scripts Copyright 2007 Vloktboky, Whitedragon(MDB), Mac, Jonathan Wilson This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. See the file COPYING for more details. 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. Only the source code to the module(s) containing the licenced code has to be released. */ #include "scripts.h" #include "engine.h" #include "gmmain.h" #include "gmscripts.h" #include <iostream> #pragma warning(disable: 4996) //Fix for the double created event bug when attaching scripts in the level loaded hook. MDB_SSGM_Base::MDB_SSGM_Base() { WasCreated = false; } void MDB_SSGM_Base::Created(GameObject *obj) { if (!WasCreated) { NewCreated(obj); WasCreated = true; } } //****************************************************************************** //****************************************************************************** //******************************* veteran STUFF ******************************** struct veteranPlayers { std::string PlayerName; int veteranPoints; }; std::vector<veteranPlayers> VetInfo; void VetUpdate(int ID, int number, int score) { if (!VetInfo.empty()) { for (int i = 0; i < VetInfo.size(); i++) { if (VetInfo[i].PlayerName == Get_Player_Name_By_ID(ID)) { int cvp, now; cvp = VetInfo[i].veteranPoints; now = number + cvp; VetInfo[i].veteranPoints = now; int Team; Team = Get_Team(ID); if (cvp < 100 && now >= 100) { char Promote[255]; sprintf(Promote,"msg veteran: %s just got promoted to the rank of General", Get_Player_Name_By_ID(ID)); Console_Input(Promote); if (Team == 0) { sprintf(Promote, "ppage %d Kane has recognised your vision, you have been promoted to General, enjoy the extra 45HP armor on all NEW characters", ID); Commands->Create_2D_WAV_Sound("bonus_complete.wav"); } else { sprintf(Promote, "ppage %d Locke himself has promoted you to a General, enjoy the extra 45HP armor on all NEW characters", ID); Commands->Create_2D_WAV_Sound("bonus_complete.wav"); } Console_Input(Promote); } else if (cvp < 60 && now >= 60) { char Promote[255]; sprintf(Promote,"msg veteran: %s just got promoted to the rank of Brigadier", Get_Player_Name_By_ID(ID)); Console_Input(Promote); if (Team == 0) { sprintf(Promote, "ppage %d The Brotherhood of Nod likes your style, you are promoted to rank Brigadier, enjoy the extra 30HP armor on all NEW characters", ID); Commands->Create_2D_WAV_Sound("m00bgwf_kill0031i1nbrs_snd.wav"); } else { sprintf(Promote, "ppage %d Keep em coming! you done all that left handed? You are promoted to Brigadier, enjoy the extra 30HP armor on all NEW characters", ID); Commands->Create_2D_WAV_Sound("m00achk_kill0034i1gbmg_snd.wav"); } Console_Input(Promote); } else if (cvp < 30 && now >= 30) { char Promote[255]; sprintf(Promote,"msg veteran: %s just got promoted to the rank of Major, he gets an extra 15HP armor on every character he now buys", Get_Player_Name_By_ID(ID)); Console_Input(Promote); if (Team == 0) { sprintf(Promote, "ppage %d Kane wants you in his elite, you are promoted to Major, enjoy the splendors of war brother as every NEW character you buy will have an extra 15HP armor", ID); Commands->Create_2D_WAV_Sound("m00avis_kick0041i1nsmg_snd.wav"); } else { sprintf(Promote, "ppage %d The deadsix needs people like you, you are promoted to Major! Every NEW character from now on will have an extra 15HP armor", ID); Commands->Create_2D_WAV_Sound("m00_wins0003eval_snd.wav"); } Console_Input(Promote); } break; } } } } int VetCheckPoints(int ID) { if (!VetInfo.empty()) { for (int i = 0; i < VetInfo.size(); i++) { if (VetInfo[i].PlayerName == Get_Player_Name_By_ID(ID)) { int Points; Points = VetInfo[i].veteranPoints; return Points; } } } return 0; } bool VetCheck(int ID) { if (!VetInfo.empty()) { for (int i = 0; i < VetInfo.size(); i++) { if (VetInfo[i].PlayerName == Get_Player_Name_By_ID(ID)) { return true; } } } return false; } void VetAddPlayer(int ID) { if (VetCheck(ID) == false) { veteranPlayers temp; temp.PlayerName = Get_Player_Name_By_ID(ID); temp.veteranPoints = 0; VetInfo.push_back(temp); } } void VetClearPlayers() { VetInfo.erase(VetInfo.begin(), VetInfo.end()); int Players = The_Game()->MaxPlayers; for (int i = 1; i <= Players; i++) { if (Get_GameObj(i)) { VetAddPlayer(i); } }; bool IsLowClassVehicle(const char *Preset) { if (strstr(Preset,"CnC_GDI_APC")) return true; else if (strstr(Preset,"CnC_GDI_Humm-vee")) return true; else if (strstr(Preset,"CnC_GDI_MRLS")) return true; else if (strstr(Preset,"CnC_Civilian_Pickup01_Secret")) return true; else if (strstr(Preset,"CnC_Civilian_Sedan01_Secret")) return true; else if (strstr(Preset,"CnC_Nod_APC")) return true; else if (strstr(Preset,"CnC_Nod_Buggy")) return true; else if (strstr(Preset,"CnC_Nod_Mobile Artillery")) return true; else if (strstr(Preset,"Nod_Chameleon")) return true; else if (strstr(Preset,"CnC_Nod_Recon_Bike")) return true; else if (strstr(Preset,"CnC_Nod_Transport")) return true; else if (strstr(Preset,"CnC_GDI_Transport")) return true; return false; } int GetPoints(const char* Preset) { int VetWorth = 0; if (stricmp(Preset,"CnC_GDI_Engineer_0") == 0) VetWorth = 1; else if (stricmp(Preset,"CnC_GDI_Engineer_2SF") == 0) VetWorth = 3; else if (stricmp(Preset,"CnC_GDI_Grenadier_0") == 0) VetWorth = 1; else if (stricmp(Preset,"CnC_GDI_Grenadier_2SF") == 0) VetWorth = 2; else if (strstr(Preset,"CnC_Ignatio_Mobius")) VetWorth = 3; else if (stricmp(Preset,"CnC_GDI_MiniGunner_0") == 0) VetWorth = 1; else if (stricmp(Preset,"CnC_GDI_MiniGunner_1Off") == 0) VetWorth = 2; else if (stricmp(Preset,"CnC_GDI_MiniGunner_2SF") == 0) VetWorth = 2; else if (strstr(Preset,"CnC_GDI_MiniGunner_3Boss")) VetWorth = 3; else if (stricmp(Preset,"CnC_GDI_RocketSoldier_0") == 0) VetWorth = 1; else if (stricmp(Preset,"CnC_GDI_RocketSoldier_1Off") == 0) VetWorth = 2; else if (stricmp(Preset,"CnC_GDI_RocketSoldier_2SF") == 0) VetWorth = 2; else if (stricmp(Preset,"CnC_Nod_Engineer_0") == 0) VetWorth = 1; else if (stricmp(Preset,"CnC_Nod_FlameThrower_0") == 0) VetWorth = 1; else if (stricmp(Preset,"CnC_Nod_FlameThrower_1Off") == 0) VetWorth = 2; else if (stricmp(Preset,"CnC_Nod_FlameThrower_2SF") == 0) VetWorth = 2; else if (strstr(Preset,"CnC_Nod_FlameThrower_3Boss")) VetWorth = 3; else if (stricmp(Preset,"CnC_Nod_Minigunner_0") == 0) VetWorth = 1; else if (stricmp(Preset,"CnC_Nod_Minigunner_1Off") == 0) VetWorth = 2; else if (stricmp(Preset,"CnC_Nod_Minigunner_2SF") == 0) VetWorth = 2; else if (strstr(Preset,"CnC_Nod_Minigunner_3Boss")) VetWorth = 3; else if (strstr(Preset,"CnC_Nod_MiniGunner_3Boss")) VetWorth = 3; else if (stricmp(Preset,"CnC_Nod_RocketSoldier_0") == 0) VetWorth = 1; else if (stricmp(Preset,"CnC_Nod_RocketSoldier_1Off") == 0) VetWorth = 2; else if (stricmp(Preset,"CnC_Nod_RocketSoldier_2SF") == 0) VetWorth = 2; else if (strstr(Preset,"CnC_Nod_RocketSoldier_3Boss")) VetWorth = 3; else if (stricmp(Preset,"CnC_Nod_Technician_0") == 0) VetWorth = 3; else if (strstr(Preset,"CnC_Sydney_PowerSuit")) VetWorth = 3; else if (stricmp(Preset,"CnC_Sydney") == 0) VetWorth = 2; else if (strstr(Preset,"CnC_GDI_APC")) VetWorth = 3; else if (strstr(Preset,"CnC_GDI_Humm-vee")) VetWorth = 2; else if (strstr(Preset,"CnC_GDI_MRLS")) VetWorth = 3; else if (strstr(Preset,"CnC_Civilian_Pickup01_Secret")) VetWorth = 2; else if (strstr(Preset,"CnC_Civilian_Sedan01_Secret")) VetWorth = 2; else if (strstr(Preset,"CnC_Nod_APC")) VetWorth = 3; else if (strstr(Preset,"CnC_Nod_Buggy")) VetWorth = 2; else if (strstr(Preset,"CnC_Nod_Mobile Artillery")) VetWorth = 3; else if (strstr(Preset,"Nod_Chameleon")) VetWorth = 2; else if (strstr(Preset,"CnC_Nod_Recon_Bike")) VetWorth = 2; else if (strstr(Preset,"CnC_Nod_Transport")) VetWorth = 2; else if (strstr(Preset,"CnC_GDI_Transport")) VetWorth = 2; else if (strstr(Preset,"CnC_GDI_Medium_Tank")) VetWorth = 4; else if (strstr(Preset,"CnC_GDI_Mammoth_Tank")) VetWorth = 5; else if (strstr(Preset,"CnC_Nod_Light_Tank")) VetWorth = 4; else if (strstr(Preset,"CnC_Nod_Flame_Tank")) VetWorth = 4; else if (strstr(Preset,"CnC_Nod_Stealth_Tank")) VetWorth = 5; else if (strstr(Preset,"CnC_Nod_Apache")) VetWorth = 4; else if (strstr(Preset,"CnC_GDI_Orca")) VetWorth = 4; else if (strstr(Preset,"CnC_GDI_Harvester")) VetWorth = 2; else if (strstr(Preset,"CnC_Nod_Harvester")) VetWorth = 2; return VetWorth; } } void reb_vet_System::Created(GameObject *obj) { int Points; Points = VetCheckPoints(Get_Player_ID(obj)); if (Points >= 100) { Level = 3; GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str()); IconID = Commands->Get_ID(Icon); Commands->Set_Model(Icon, "p_keycrd_red"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); Set_Max_Shield_Strength(obj, 145); Commands->Set_Shield_Strength(obj, 145); Commands->Start_Timer(obj, this, 2.0f, 3); } else if (Points >= 60) { Level = 2; GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str()); Commands->Set_Model(Icon, "p_keycrd_yel"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); IconID = Commands->Get_ID(Icon); Set_Max_Shield_Strength(obj, 130); Commands->Set_Shield_Strength(obj, 130); } else if (Points >= 30) { Level = 1; GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str()); Commands->Set_Model(Icon, "p_keycrd_grn"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); IconID = Commands->Get_ID(Icon); if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_FlameThrower_2SF")){ } Set_Max_Shield_Strength(obj, 115); Commands->Set_Shield_Strength(obj, 115); } else { Level = 0; } Commands->Start_Timer(obj, this, 60.0f, 10); } void reb_vet_System::Custom(GameObject *obj, int message, int param, GameObject *sender) { if (message == CUSTOM_EVENT_VEHICLE_ENTER) { Commands->Destroy_Object(Commands->Find_Object(IconID)); } else if (Level == 3) { GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str()); Commands->Set_Model(Icon, "p_keycrd_red"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); IconID = Commands->Get_ID(Icon); float Shield; Shield = Commands->Get_Shield_Strength(obj); Set_Max_Shield_Strength(obj, 145); Commands->Set_Shield_Strength(obj, Shield); } else if (Level == 2) { GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str()); Commands->Set_Model(Icon, "p_keycrd_yel"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); IconID = Commands->Get_ID(Icon); float Shield; Shield = Commands->Get_Shield_Strength(obj); Set_Max_Shield_Strength(obj, 130); Commands->Set_Shield_Strength(obj, Shield); } else if (Level == 1) { GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str()); IconID = Commands->Get_ID(Icon); Commands->Set_Model(Icon, "p_keycrd_grn"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_FlameThrower_2SF")){ } float Shield; Shield = Commands->Get_Shield_Strength(obj); Set_Max_Shield_Strength(obj, 115); Commands->Set_Shield_Strength(obj, Shield); } Commands->Start_Timer(obj, this, 60.0f, 10); } void reb_vet_System::Timer_Expired(GameObject *obj, int number) { if (number == 3) { Commands->Apply_Damage(obj, -1.0f, "Repair", false); Commands->Start_Timer(obj, this, 2.0f, 5); } else if (number == 10) { int Points; Points = VetCheckPoints(Get_Player_ID(obj)); if (Points >= 100 && Level < 3) { Level = 3; if (Get_Vehicle(obj) == 0) { Commands->Destroy_Object(Commands->Find_Object(ID)); GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Set_Model(Icon, "p_keycrd_red"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); ID = Commands->Get_ID(Icon); } Commands->Start_Timer(obj, this, 2.0f, 3); } else if (Points >= 60 && Level < 2) { Level = 2; if (Get_Vehicle(obj) == 0) { Commands->Destroy_Object(Commands->Find_Object(ID)); GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Set_Model(Icon, "p_keycrd_yel"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); ID = Commands->Get_ID(Icon); } } else if (Points >= 30 && Level < 1) { Level = 1; if (Get_Vehicle(obj) == 0) { Commands->Destroy_Object(Commands->Find_Object(ID)); GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH"); Commands->Set_Model(Icon, "p_keycrd_grn"); Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH"); ID = Commands->Get_ID(Icon); } } Commands->Start_Timer(obj, this, 60.0f, 10); } } void reb_vet_System::Killed(GameObject *obj, GameObject *shooter) { Destroy_Script(); } void reb_vet_System::Destroyed(GameObject *obj) { Commands->Destroy_Object(Commands->Find_Object(IconID)); Destroy_Script(); } void reb_vet_System_Vehicles::Custom(GameObject *obj, int message, int param, GameObject *sender) { if (message == CUSTOM_EVENT_VEHICLE_ENTER) { int Points; Points = VetCheckPoints(Get_Player_ID(sender)); if (Points >= 100) { Level = 3; IsPoweredUp = true; if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) { //nothing } else { Commands->Start_Timer(obj, this, 1.0f, 3); } } else if (Points >= 60) { Level = 2; IsPoweredUp = true; if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) { //nothing Commands->Start_Timer(obj, this, 1.0f, 2); } else { Commands->Start_Timer(obj, this, 1.0f, 3); } } else if (Points >= 30) { Level = 1; IsPoweredUp = true; if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) { //nothing } else { Commands->Start_Timer(obj, this, 1.0f, 1); } } Commands->Send_Custom_Event(sender, sender, CUSTOM_EVENT_VEHICLE_ENTER, 0, 0); } else if (message == CUSTOM_EVENT_VEHICLE_EXIT) { if (IsPoweredUp == true) { IsPoweredUp = false; if (Level == 1) { if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) { //nothing } } else if (Level == 2) { if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) { //nothing } } else if (Level == 3) { if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) { //nothing } } } Commands->Send_Custom_Event(sender, sender, CUSTOM_EVENT_VEHICLE_EXIT, 0, 0); } } void reb_vet_System_Vehicles::Timer_Expired(GameObject *obj, int number) { if (number == 3 && IsPoweredUp == true) { Commands->Destroy_Object(Commands->Find_Object(ID)); Commands->Apply_Damage(obj, -3.0f, "Repair", false); Commands->Start_Timer(obj, this, 1.0f, 3); } else if (number == 2 && IsPoweredUp == true) { float Health, MaxHealth; Health = Commands->Get_Health(obj); MaxHealth = Commands->Get_Max_Health(obj); if (Health == MaxHealth) { // Nothing } else if (Health >= MaxHealth - 2) { Commands->Set_Health(obj, MaxHealth); } else if (Health <= MaxHealth - 3) { Commands->Set_Health(obj, Health + 3); } Commands->Start_Timer(obj, this, 1.0f, 2); } else if (number == 1 && IsPoweredUp == true) { float Shield, MaxShield; Shield = Commands->Get_Shield_Strength(obj); MaxShield = Commands->Get_Max_Shield_Strength(obj); if (Shield == MaxShield) { // Nothing } else if (Shield >= MaxShield - 2) { Commands->Set_Shield_Strength(obj, MaxShield); } else if (Shield <= MaxShield - 3) { Commands->Set_Shield_Strength(obj, Shield + 3); } Commands->Start_Timer(obj, this, 1.0f, 1); } } void reb_vet_System_Vehicles::Killed(GameObject *obj, GameObject *shooter) { Commands->Destroy_Object(Commands->Find_Object(ID)); Destroy_Script(); } void reb_vet_System_Vehicles::Destroyed(GameObject *obj) { Commands->Destroy_Object(Commands->Find_Object(ID)); Destroy_Script(); }
I totally agree with Reborn. For ages now it seems that there is a combat between the Server Admins. Everyone of them wants to have the best & new enhancements instead of providing unique Servers with different gameplay. A quick example: The CCTF mod. I wanted to have it in 2005/2006. Everybody has kept it private, so I asked TGpaddy (TG changed to SoD later FYI). He refused to send it to me. And guess what? I created my own CCTF mod which differed from all other crazy mods. For the Vetplugin I believe BC had this first. I don't know if I am right, but I saw it first on BCserv4 (the AOW) years ago. I mean, it's easier to make a modified objects than writing scripts from scratch. So no wondering why people often want to have the finished files and only a few skilled do modify them for their own needs. So again, I think this is a Community and people should share their work. I for my self do it this way.
whats wrong with this!!!! for (int i = 0; i < VetInfo.size(); ++i) { it says this .\gmscripts.cpp(48) : warning C4018: '<' : signed/unsigned mismatch
Quote: So again, I think this is a Community and people should share their work. I for my self do it this way. Revoke the a00 shit and i will share my work.
Darknes2 wrote on Sat, 08 March 2008 15:22 for (unsigned int i = 0; i < VetInfo.size(); ++i) {
ok well i got THAT fixed now 1 last thing... the on player join and gameover hooks are in gmmain and the rest of the vet code is in gmscripts .... and it wont let me put the addvetplayer and clearvetplayers things to them because of that.. so how do i make it work?
Just declare the function in the second file. Like void function1(int lol) { dostuff();} in file1, and then void function1(int lol); in file2.
Hmm... Where is problem? Error 1 error C2220: warning treated as error - no 'object' file generated c:\ExScripts\SSGM Source\gmscripts.cpp 104 Warning 2 warning C4018: '<' : signed/unsigned mismatch c:\ExScripts\SSGM Source\gmscripts.cpp 104 Warning 3 warning C4018: '<' : signed/unsigned mismatch c:\ExScripts\SSGM Source\gmscripts.cpp 117 Error 4 error C2601: 'IsLowClassVehicle' : local function definitions are illegal c:\ExScripts\SSGM Source\gmscripts.cpp 143 Error 5 error C2601: 'GetPoints' : local function definitions are illegal c:\ExScripts\SSGM Source\gmscripts.cpp 158 Error 6 error C2653: 'reb_vet_System' : is not a class or namespace name c:\ExScripts\SSGM Source\gmscripts.cpp 215 Error 7 error C2065: 'Level' : undeclared identifier c:\ExScripts\SSGM Source\gmscripts.cpp 219 Error 8 error C2065: 'IconID' : undeclared identifier c:\ExScripts\SSGM Source\gmscripts.cpp 223 Error 9 error C2673: 'Created' : global functions do not have 'this' pointers c:\ExScripts\SSGM Source\gmscripts.cpp 229 Error 10 error C2673: 'Created' : global functions do not have 'this' pointers c:\ExScripts\SSGM Source\gmscripts.cpp 265 Error 11 error C2653: 'reb_vet_System' : is not a class or namespace name c:\ExScripts\SSGM Source\gmscripts.cpp 268 Error 12 error C2673: 'Custom' : global functions do not have 'this' pointers c:\ExScripts\SSGM Source\gmscripts.cpp 312 Error 13 error C2653: 'reb_vet_System' : is not a class or namespace name c:\ExScripts\SSGM Source\gmscripts.cpp 318 Error 14 error C2673: 'Timer_Expired' : global functions do not have 'this' pointers c:\ExScripts\SSGM Source\gmscripts.cpp 321 Error 15 error C2065: 'ID' : undeclared identifier c:\ExScripts\SSGM Source\gmscripts.cpp 329 Error 16 error C2673: 'Timer_Expired' : global functions do not have 'this' pointers c:\ExScripts\SSGM Source\gmscripts.cpp 336 Error 17 error C2673: 'Timer_Expired' : global functions do not have 'this' pointers c:\ExScripts\SSGM Source\gmscripts.cpp 360 Error 18 error C2653: 'reb_vet_System' : is not a class or namespace name c:\ExScripts\SSGM Source\gmscripts.cpp 365 Error 19 error C3861: 'Destroy_Script': identifier not found c:\ExScripts\SSGM Source\gmscripts.cpp 367 Error 20 error C2653: 'reb_vet_System' : is not a class or namespace name c:\ExScripts\SSGM Source\gmscripts.cpp 370 Error 21 error C3861: 'Destroy_Script': identifier not found c:\ExScripts\SSGM Source\gmscripts.cpp 372 Error 22 error C2653: 'reb_vet_System_Vehicles' : is not a class or namespace name c:\ExScripts\SSGM Source\gmscripts.cpp 375 Error 23 error C2084: function 'void Custom(GameObject *,int,int,GameObject *)' already has a body c:\ExScripts\SSGM Source\gmscripts.cpp 375 Error 24 error C2065: 'IsPoweredUp' : undeclared identifier c:\ExScripts\SSGM Source\gmscripts.cpp 381 Warning 25 warning C4805: '==' : unsafe mix of type ''unknown-type'' and type 'bool' in operation c:\ExScripts\SSGM Source\gmscripts.cpp 383 Error 26 error C3861: 'IsLowClassVehicle': identifier not found c:\ExScripts\SSGM Source\gmscripts.cpp 383 Error 27 error C2673: 'Custom' : global functions do not have 'this' pointers c:\ExScripts\SSGM Source\gmscripts.cpp 387 Warning 28 warning C4805: '==' : unsafe mix of type ''unknown-type'' and type 'bool' in operation c:\ExScripts\SSGM Source\gmscripts.cpp 394 Error 29 error C3861: 'IsLowClassVehicle': identifier not found c:\ExScripts\SSGM Source\gmscripts.cpp 394 Error 30 error C2673: 'Custom' : global functions do not have 'this' pointers c:\ExScripts\SSGM Source\gmscripts.cpp 397 Error 31 error C2673: 'Custom' : global functions do not have 'this' pointers c:\ExScripts\SSGM Source\gmscripts.cpp 400 Warning 32 warning C4805: '==' : unsafe mix of type ''unknown-type'' and type 'bool' in operation c:\ExScripts\SSGM Source\gmscripts.cpp 407 Error 33 error C3861: 'IsLowClassVehicle': identifier not found c:\ExScripts\SSGM Source\gmscripts.cpp 407 Error 34 error C2673: 'Custom' : global functions do not have 'this' pointers c:\ExScripts\SSGM Source\gmscripts.cpp 411 Warning 35 warning C4805: '==' : unsafe mix of type ''unknown-type'' and type 'bool' in operation c:\ExScripts\SSGM Source\gmscripts.cpp 417 Warning 36 warning C4805: '==' : unsafe mix of type ''unknown-type'' and type 'bool' in operation c:\ExScripts\SSGM Source\gmscripts.cpp 420 Error 37 error C3861: 'IsLowClassVehicle': identifier not found c:\ExScripts\SSGM Source\gmscripts.cpp 420 Warning 38 warning C4805: '==' : unsafe mix of type ''unknown-type'' and type 'bool' in operation c:\ExScripts\SSGM Source\gmscripts.cpp 425 Error 39 error C3861: 'IsLowClassVehicle': identifier not found c:\ExScripts\SSGM Source\gmscripts.cpp 425 Warning 40 warning C4805: '==' : unsafe mix of type ''unknown-type'' and type 'bool' in operation c:\ExScripts\SSGM Source\gmscripts.cpp 430 Error 41 error C3861: 'IsLowClassVehicle': identifier not found c:\ExScripts\SSGM Source\gmscripts.cpp 430 Error 42 error C2653: 'reb_vet_System_Vehicles' : is not a class or namespace name c:\ExScripts\SSGM Source\gmscripts.cpp 438 Error 43 error C2084: function 'void Timer_Expired(GameObject *,int)' already has a body c:\ExScripts\SSGM Source\gmscripts.cpp 438 Warning 44 warning C4805: '==' : unsafe mix of type ''unknown-type'' and type 'bool' in operation c:\ExScripts\SSGM Source\gmscripts.cpp 439 Error 45 error C2673: 'Timer_Expired' : global functions do not have 'this' pointers c:\ExScripts\SSGM Source\gmscripts.cpp 442 Warning 46 warning C4805: '==' : unsafe mix of type ''unknown-type'' and type 'bool' in operation c:\ExScripts\SSGM Source\gmscripts.cpp 444 Error 47 error C2673: 'Timer_Expired' : global functions do not have 'this' pointers c:\ExScripts\SSGM Source\gmscripts.cpp 457 Warning 48 warning C4805: '==' : unsafe mix of type ''unknown-type'' and type 'bool' in operation c:\ExScripts\SSGM Source\gmscripts.cpp 459 Error 49 error C2673: 'Timer_Expired' : global functions do not have 'this' pointers c:\ExScripts\SSGM Source\gmscripts.cpp 472 Error 50 error C2653: 'reb_vet_System_Vehicles' : is not a class or namespace name c:\ExScripts\SSGM Source\gmscripts.cpp 476 Error 51 error C2084: function 'void Killed(GameObject *,GameObject *)' already has a body c:\ExScripts\SSGM Source\gmscripts.cpp 476 Error 52 error C3861: 'Destroy_Script': identifier not found c:\ExScripts\SSGM Source\gmscripts.cpp 478 Error 53 error C2653: 'reb_vet_System_Vehicles' : is not a class or namespace name c:\ExScripts\SSGM Source\gmscripts.cpp 481 Error 54 error C2084: function 'void Destroyed(GameObject *)' already has a body c:\ExScripts\SSGM Source\gmscripts.cpp 481 Error 55 error C3861: 'Destroy_Script': identifier not found c:\ExScripts\SSGM Source\gmscripts.cpp 483 Error 56 error C3861: 'GetPoints': identifier not found c:\ExScripts\SSGM Source\gmscripts.cpp 789 Error 57 error C3861: 'GetPoints': identifier not found c:\ExScripts\SSGM Source\gmscripts.cpp 1097 Warning 58 warning C4244: 'argument' : conversion from 'float' to 'int', possible loss of data c:\ExScripts\SSGM Source\gmscripts.cpp 2238 Error 59 error C3861: 'VetAddPlayer': identifier not found c:\ExScripts\SSGM Source\gmmain.cpp 683 Error 60 error C3861: 'VetClearPlayers': identifier not found c:\ExScripts\SSGM Source\gmmain.cpp 829 Error 61 error C2065: 'VetInfo' : undeclared identifier c:\ExScripts\SSGM Source\gmmain.cpp 1343 Error 62 error C2228: left of '.empty' must have class/struct/union c:\ExScripts\SSGM Source\gmmain.cpp 1343 Error 63 error C2228: left of '.size' must have class/struct/union c:\ExScripts\SSGM Source\gmmain.cpp 1344 Error 64 error C2228: left of '.PlayerName' must have class/struct/union c:\ExScripts\SSGM Source\gmmain.cpp 1345 Error 65 error C2228: left of '.veteranPoints' must have class/struct/union c:\ExScripts\SSGM Source\gmmain.cpp 1348
error C2653: 'reb_vet_System' : is not a class or namespace name c:\ExScripts\SSGM Source\gmscripts.cpp 215 = paste the whole script into the gmmain.cpp and the class into gmmain.h, this could/should help. I do it this way and everything works. -------- error C2601: 'GetPoints' : local function definitions are illegal c:\ExScripts\SSGM Source\gmscripts.cpp = Get_Points would be a valid scripts command. Over all, the whole code should be placed in one file. You cannot split Reborns' main code because the gmmain.cpp has zero access to the gmscripts.cpp if I am interpreting the include-Syntax right. In the other way, the gmscripts can read gmmain, gmcrate etc. I probably fail with this post, but I do think it goes in the right direction.
Send me your solution and I will fix it.
OK. When I come at home I send you pm. Thanks
Fixed, check your PM's. C++ is case sensitive, GetPoints is not the same as getPoints. Most errors seemed to be case sensitive issues.
reborn wrote on Tue, 13 May 2008 01:20 Fixed, check your PM's. C++ is case sensitive, GetPoints is not the same as getPoints. Most errors seemed to be case sensitive issues. Thanks.
hey can some1 please give me a Vet plugin for NR... ive checked evry where but cannot find it
NR doesnt have a Vet system. as reborn explained, this is a c++ script, so just add the script into SSGM Source and compile it. if yoru not sure how to add those scripts then ask on the DCOM forum. http://forums.dcomproductions.net/viewforum.php?f=46 good luck
lol good luck ... yea im gonna need it bad haha! i know nothing about scripting...
nodmanmik wrote on Sun, 18 May 2008 14:59 i know nothing about scripting... I think it's time to learn it...
lol so do i... how can i learn? a website? ... hehe
Buy this book: http://www.amazon.co.uk/C%2B%2B-Without-Fear-Beginners-Guide/dp/0321246950/ref=s r_1_1?ie=UTF8&s=books&qid=1211201251&sr=8-1 I have quite allot of books on C++, for me, this was the best book for learning it at an introductory level. I should of started with this book first, instead I got half way through C++ for dummies and regretted ever buying it. The one I linked to is very affordable and a great way to start learning. Buy it. Read it. Learn it. Love it.
That's the book I used to learn C++... Thanks, Zack
nodmanmik wrote on Mon, 19 May 2008 14:22 lol so do i... how can i learn? a website? ... hehe For example. Books, websites, friends etc... I also dont know C++ and when I have some problems Im trying to fix it or ask someone for help. But this is gonna off topic.
thats ok... ty for the advice people..
www.learncpp.com is the path I took, along with C++ for dummies. However, I already had some experience in C. I've done no Renegade scripting, but from the looks of it, scripting is very template driven and object-oriented.
hrm... ill look up on it! thanks people for helping!
I decided to upgrade the veteran system that I posted here to use in cnc_reborn. I changed it so that it rewards players for healing/repairing and disarming. I also added some little notices for players too, these notices will only be displayed for people using the upgraded client scripts.dll, but for cnc_reborn that's fine. Here is the changes I made. struct RepPlayers { std::string RepPlayerName; int RepPoints; }; std::vector<RepPlayers> RepInfo; void RepUpdate(int ID, int number) { if (!RepInfo.empty()) { for (int i = 0; i < RepInfo.size(); i++) { if (RepInfo[i].RepPlayerName == Get_Player_Name_By_ID(ID)) { int cvp, now; cvp = RepInfo[i].RepPoints; now = number + cvp; RepInfo[i].RepPoints = now; if (cvp < 200 && now >= 200) { VetUpdate(ID, 1, Commands->Get_Points(Get_GameObj(ID))); Display_Int_Player(Get_GameObj(ID),1,"Bonus repairing veteran points gained: 1"); RepInfo[i].RepPoints = 0; now = 0; cvp = 0; } break; } } } } int RepCheckPoints(int ID) { if (!RepInfo.empty()) { for (int i = 0; i < RepInfo.size(); i++) { if (RepInfo[i].RepPlayerName == Get_Player_Name_By_ID(ID)) { int Points; Points = RepInfo[i].RepPoints; return Points; } } } return 0; } bool RepCheck(int ID) { if (!RepInfo.empty()) { for (int i = 0; i < RepInfo.size(); i++) { if (RepInfo[i].RepPlayerName == Get_Player_Name_By_ID(ID)) { return true; } } } return false; } void RepAddPlayer(int ID) { if (RepCheck(ID) == false) { RepPlayers temp; temp.RepPlayerName = Get_Player_Name_By_ID(ID); temp.RepPoints = 0; RepInfo.push_back(temp); } } void RepClearPlayers() { RepInfo.erase(RepInfo.begin(), RepInfo.end()); int Players = The_Game()->MaxPlayers; for (int i = 1; i <= Players; i++) { if (Get_GameObj(i)) { RepAddPlayer(i); } } } Then on the ::Damaged events for the vehicles, players and buildings I did the following: void MDB_SSGM_Vehicle::Damaged(GameObject *obj, GameObject *damager, float damage) { if(damage < 0){ if (Commands->Is_A_Star(damager) && Commands->Get_Player_Type(damager) == Commands->Get_Player_Type(obj)){ RepUpdate(Get_Player_ID(damager), ((damage - damage) - damage)/2); } } if (damage > 0.0f) { LastDamage = damage; } } void MDB_SSGM_Player::Damaged(GameObject *obj, GameObject *damager, float damage) { if(damage < 0){ if (Commands->Is_A_Star(damager) && Commands->Get_Player_Type(damager) == Commands->Get_Player_Type(obj)){ RepUpdate(Get_Player_ID(damager), ((damage - damage) - damage)); } } if ((IsSecondWind == true) && (Commands->Get_Health(obj) <= 25) && (Commands->Get_Health(obj) > 0)) { IsSecondWind = false; Commands->Set_Health(obj,Commands->Get_Max_Health(obj)); Commands->Set_Shield_Strength(obj,Commands->Get_Max_Shield_Strength(obj)); } } void MDB_SSGM_Building::Damaged(GameObject *obj, GameObject *damager, float damage) { if(damage < 0){ if (Commands->Is_A_Star(damager) && Commands->Get_Player_Type(damager) == Get_Object_Type(obj)){ RepUpdate(Get_Player_ID(damager), ((damage - damage) - damage)); } } void MDB_SSGM_Beacon::Killed(GameObject *obj, GameObject *shooter) { VetUpdate(Get_Player_ID(shooter), 5, Commands->Get_Points(shooter)); Display_Int_Player(shooter,5,"bonus veteran points gained: 5"); if (IsDisarmed == false) { IsDisarmed = true; FDSMessage(StrFormat("%ls disarmed a %s",Get_Wide_Player_Name(shooter),Translate_Preset(obj).c_str()),"_BEACON"); } } void MDB_SSGM_C4::Killed(GameObject *obj, GameObject *shooter) { VetUpdate(Get_Player_ID(shooter), 1, Commands->Get_Points(shooter)); Display_Int_Player(shooter,1,"Bonus veteran points gained: 1"); if (Settings->LogC4) { FDSMessage(StrFormat("%ls %s has been disarmed by %ls (Owner: %ls - Attached to: %s)",Get_Wide_Team_Name(Get_Object_Type(obj)),Translate_Preset(obj).c_str(),Get_Wide_Player_Name(shooter),Get_Wide_Player_Name(Get_C4_Planter(obj)),Translate_Preset(Get_C4_Attached(obj)).c_str()),"_C4"); } WasDisarmed = true; } I added the script to players on the join hook, the same as the veteran thing, here: void Player_Join_Hook(int i,const char *Nick) { VetAddPlayer(i); RepAddPlayer(i); And I clear the info on the game over event here: void GameOver() { VetClearPlayers(); RepClearPlayers(); char ObjectsType[10],ObjectsType2[10],ObjectsFile[20]; I also added those little messages on the normal veteran points gained too, here: void MDB_SSGM_Vehicle::Killed(GameObject *obj, GameObject *shooter) { if (Commands->Is_A_Star(shooter)){ VetUpdate(Get_Player_ID(shooter), GetPoints(Commands->Get_Preset_Name(obj)), Commands->Get_Points(shooter)); Display_Int_Player(shooter,GetPoints(Commands->Get_Preset_Name(obj)),"Veteran points gained: %d"),GetPoints(Commands->Get_Preset_Name(obj)); void MDB_SSGM_Player::Killed(GameObject *obj, GameObject *shooter) { if (Commands->Is_A_Star(shooter) && Commands->Get_Player_Type(shooter) != Commands->Get_Player_Type(obj)) { VetUpdate(Get_Player_ID(shooter), GetPoints(Commands->Get_Preset_Name(obj)), Commands->Get_Points(shooter)); Display_Int_Player(shooter,GetPoints(Commands->Get_Preset_Name(obj)),"Veteran points gained: %d"),GetPoints(Commands->Get_Preset_Name(obj)); void MDB_SSGM_Building::Killed(GameObject *obj, GameObject *shooter) { if (Commands->Is_A_Star(shooter)){ VetUpdate(Get_Player_ID(shooter), 25, Commands->Get_Points(shooter)); Display_Int_Player(shooter,25,"Veteran points gained: 25"); } Hope someone finds a use for it.. I may even make it a plug-in if I have time in the next few days, maybe... Also, my maths seems to be fading away from me... There must be a better way to turn a negative number into a positive number, rather then "(damage - damage) - damage)".
Ehm. Could you tell me to which files I must add it?
reborn wrote on Sat, 24 May 2008 15:44 Also, my maths seems to be fading away from me... There must be a better way to turn a negative number into a positive number, rather then "(damage - damage) - damage)". #include <cstdlib> abs(number); or, for floating point numbers #include <cmath> fabs(number); Or, if you already know for sure the number is negative; int number = -number;
danpaul88 wrote on Sat, 24 May 2008 11:36 reborn wrote on Sat, 24 May 2008 15:44 Also, my maths seems to be fading away from me... There must be a better way to turn a negative number into a positive number, rather then "(damage - damage) - damage)". Or, if you already know for sure the number is negative; int number = -number; Thanks DP
not many people can make fun of your code reborn it seems to me like you have coded half the modded servers ive played one example hunt the player (mvrtech) awesome idea that no one else has had
reborn wrote on Tue, 04 December 2007 18:00 I believe that making your code available to everyone is a good thing. well then release all the source for C&C Reborn.
I'll be releasing the code that runs on the official server and the compiled scripts.dll, which is based on SSGM. I don't understand why you think I wouldn't :-/ This is getting rather off-topic though.
is there a way to make the levels infinite? and the reward increase based on the level?
Yeah, that's possible. You could make the reward directly proportionate to the veteran level itself or the veteran points they have. I'll throw something together...
Thanks much. A couple of things though. does it read from an ini to get settings? and if so for the names of the levels is it possible to make them read the names from a list and for a level like 50 if you have no name it just displays "promoted to level 50". and I really suck @ c++, best I ever did was modify what you get in the crates. could you compile it for me? thanks.
EA-DamageEverything wrote on Sun, 11 May 2008 22:04 error C2653: 'reb_vet_System' : is not a class or namespace name c:\ExScripts\SSGM Source\gmscripts.cpp 215 = paste the whole script into the gmmain.cpp and the class into gmmain.h, this could/should help. I do it this way and everything works. -------- error C2601: 'GetPoints' : local function definitions are illegal c:\ExScripts\SSGM Source\gmscripts.cpp = Get_Points would be a valid scripts command. Over all, the whole code should be placed in one file. You cannot split Reborns' main code because the gmmain.cpp has zero access to the gmscripts.cpp if I am interpreting the include-Syntax right. In the other way, the gmscripts can read gmmain, gmcrate etc. I probably fail with this post, but I do think it goes in the right direction. Ok, ive copied and pasted the whole script into the gmmain.cpp and class into gmmain.h but i got 45 errors/warnings Here they are HERE!!!! ------ Build started: Project: SSGM, Configuration: Debug Win32 ------ Compiling... gmmain.cpp .\gmmain.cpp(1466) : error C2220: warning treated as error - no 'object' file generated .\gmmain.cpp(1466) : warning C4018: '<' : signed/unsigned mismatch .\gmmain.cpp(1525) : warning C4018: '<' : signed/unsigned mismatch .\gmmain.cpp(1538) : warning C4018: '<' : signed/unsigned mismatch .\gmmain.cpp(1735) : warning C4805: '==' : unsafe mix of type ''unknown-type'' and type 'bool' in operation .\gmmain.cpp(1735) : error C3861: 'IsLowClassVehicle': identifier not found .\gmmain.cpp(1746) : warning C4805: '==' : unsafe mix of type ''unknown-type'' and type 'bool' in operation .\gmmain.cpp(1746) : error C3861: 'IsLowClassVehicle': identifier not found .\gmmain.cpp(1759) : warning C4805: '==' : unsafe mix of type ''unknown-type'' and type 'bool' in operation .\gmmain.cpp(1759) : error C3861: 'IsLowClassVehicle': identifier not found .\gmmain.cpp(1772) : warning C4805: '==' : unsafe mix of type ''unknown-type'' and type 'bool' in operation .\gmmain.cpp(1772) : error C3861: 'IsLowClassVehicle': identifier not found .\gmmain.cpp(1777) : warning C4805: '==' : unsafe mix of type ''unknown-type'' and type 'bool' in operation .\gmmain.cpp(1777) : error C3861: 'IsLowClassVehicle': identifier not found .\gmmain.cpp(1782) : warning C4805: '==' : unsafe mix of type ''unknown-type'' and type 'bool' in operation .\gmmain.cpp(1782) : error C3861: 'IsLowClassVehicle': identifier not found .\gmmain.cpp(1842) : error C2084: function 'void Player_Join_Hook(int,const char *)' already has a body .\gmmain.cpp(689) : see previous definition of 'Player_Join_Hook' .\gmmain.cpp(1860) : error C2084: function 'void GameOver(void)' already has a body .\gmmain.cpp(839) : see previous definition of 'GameOver' .\gmmain.cpp(1899) : error C2653: 'vet_MDB_SSGM_Building' : is not a class or namespace name .\gmmain.cpp(1899) : error C2601: 'Killed' : local function definitions are illegal .\gmmain.cpp(1860): this line contains a '{' which has not yet been matched .\gmmain.cpp(1926) : error C2065: 'vet_MDB_SSGM_Building' : undeclared identifier .\gmmain.cpp(1926) : error C2514: 'ScriptRegistrant' : class has no constructors c:\westwood\renegadefds\server\scripts.h(480) : see declaration of 'ScriptRegistrant' .\gmmain.cpp(1929) : error C2063: 'Killed' : not a function .\gmmain.cpp(1929) : error C2601: 'vet_MDB_SSGM_Building::Killed' : local function definitions are illegal .\gmmain.cpp(1860): this line contains a '{' which has not yet been matched .\gmmain.cpp(1930) : error C2065: 'shooter' : undeclared identifier .\gmmain.cpp(1939) : error C2065: 'obj' : undeclared identifier .\gmmain.cpp(1939) : error C2228: left of '.c_str' must have class/struct/union .\gmmain.cpp(1942) : error C2228: left of '.c_str' must have class/struct/union .\gmmain.cpp(1942) : error C2228: left of '.c_str' must have class/struct/union .\gmmain.cpp(1948) : error C2065: 'IsAlive' : undeclared identifier .\gmmain.cpp(1951) : error C2227: left of '->Destroy_Base' must point to class/struct/union/generic type .\gmmain.cpp(1957) : error C2514: 'ScriptRegistrant' : class has no constructors c:\westwood\renegadefds\server\scripts.h(480) : see declaration of 'ScriptRegistrant' .\gmmain.cpp(1959) : error C2653: 'vet_MDB_SSGM_Player' : is not a class or namespace name .\gmmain.cpp(1963) : error C3861: 'GetPoints': identifier not found .\gmmain.cpp(1965) : error C2065: 'WasKilled' : undeclared identifier .\gmmain.cpp(2023) : error C2065: 'vet_MDB_SSGM_Player' : undeclared identifier .\gmmain.cpp(2023) : error C2514: 'ScriptRegistrant' : class has no constructors c:\westwood\renegadefds\server\scripts.h(480) : see declaration of 'ScriptRegistrant' .\gmmain.cpp(2025) : error C2653: 'vet_MDB_SSGM_Vehicle' : is not a class or namespace name .\gmmain.cpp(2025) : error C2084: function 'void Killed(GameObject *,GameObject *)' already has a body .\gmmain.cpp(1959) : see previous definition of 'Killed' .\gmmain.cpp(2028) : error C3861: 'GetPoints': identifier not found .\gmmain.cpp(2040) : error C2065: 'LastDamage' : undeclared identifier .\gmmain.cpp(2180) : error C2065: 'vet_MDB_SSGM_Vehicle' : undeclared identifier .\gmmain.cpp(2180) : error C2514: 'ScriptRegistrant' : class has no constructors c:\westwood\renegadefds\server\scripts.h(480) : see declaration of 'ScriptRegistrant' .\gmmain.cpp(2181) : fatal error C1075: end of file found before the left brace '{' at '.\gmmain.cpp(1860)' was matched Creating browse information file... Microsoft Browse Information Maintenance Utility Version 8.00.50727 Copyright (C) Microsoft Corporation. All rights reserved. BSCMAKE: error BK1506 : cannot open file '.\tmp\scripts\debug\gmmain.sbr': No such file or directory Build log was saved at "file://c:\Westwood\RenegadeFDS\Server\tmp\scripts\debug\BuildLog.htm" SSGM - 36 error(s), 9 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I think it would be good if you knew and understood the code rather than just copy and paste everything reborn puts up here. You should check where you pasted the code, because you may have stuffed them into another method/function instead of in a blank space.
I know where every thing goes. Most of the other commands are working. But when i tried doing this one, i had alot of errors. So i just read most of the replies and found this one and said that it might work. But it seems not to.
You're missing some functions, and your compiler is complaining about some warnings that in this instance do not really matter. You're also missing at least one global variable, and I'm pretty sure you've either renamed some mdb scripts, or you've accidently missed a semi-colon or something.
can you tell me where everything goes. does every thing just go in gmmain
Me personally, I put it all in gmmain.cpp, and migrated the mdb_ and ssgm scripts I altered into there too.
What did i do worng 0_o gmmain errors 1>gmmain.cpp 1>.\gmmain.cpp(697) : error C3861: 'VetAddPlayer': identifier not found 1>.\gmmain.cpp(845) : error C3861: 'VetClearPlayers': identifier not found 1>.\gmmain.cpp(848) : error C2086: 'char ObjectsType[10]' : redefinition 1> .\gmmain.cpp(846) : see declaration of 'ObjectsType' 1>.\gmmain.cpp(848) : error C2086: 'char ObjectsType2[10]' : redefinition 1> .\gmmain.cpp(846) : see declaration of 'ObjectsType2' 1>.\gmmain.cpp(848) : error C2086: 'char ObjectsFile[20]' : redefinition 1> .\gmmain.cpp(846) : see declaration of 'ObjectsFile' 1>.\gmmain.cpp(2404) : warning C4018: '<' : signed/unsigned mismatch 1>.\gmmain.cpp(2463) : warning C4018: '<' : signed/unsigned mismatch 1>.\gmmain.cpp(2476) : warning C4018: '<' : signed/unsigned mismatch 1>.\gmmain.cpp(2485) : error C2365: 'VetAddPlayer' : redefinition; previous definition was 'formerly unknown identifier' 1>.\gmmain.cpp(2494) : error C2365: 'VetClearPlayers' : redefinition; previous definition was 'formerly unknown identifier' 1>.\gmmain.cpp(2499) : error C3861: 'VetAddPlayer': identifier not found 1>.\gmmain.cpp(2781) : warning C4018: '<' : signed/unsigned mismatch 1>SSGM - 8 error(s), 4 warning(s) gmscripts errors 1>Compiling... 1>gmscripts.cpp 1>.\gmscripts.cpp(336) : error C3861: 'VetUpdate': identifier not found 1>.\gmscripts.cpp(336) : error C3861: 'GetPoints': identifier not found 1>.\gmscripts.cpp(1664) : error C3861: 'VetUpdate': identifier not found 1>SSGM - 3 error(s), 0 warning(s) missing somthing in the h file for gmscripts ?
You've not moved all the scripts that call those functions into the same .cpp file. I moved them all into gmmain.cpp.