Home » Renegade Discussions » Mod Forum » Random Char Error I need Fixed
Random Char Error I need Fixed [message #270219] |
Mon, 02 July 2007 14:24 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
ok im try to explain this easiest way i can
heres my arry
char *RandomGDIChar[14][2] = {
{ "GDI Officer", "CnC_GDI_MiniGunner_1Off" },
{ "GDI Rocket Soldier", "CnC_GDI_RocketSoldier_1Off" },
{ "GDI Sydney", "CnC_Sydney" },
{ "GDI Deadeye", "CnC_GDI_MiniGunner_2SF" },
{ "GDI Gunner", "CnC_GDI_RocketSoldier_2SF" },
{ "GDI Patch", "CnC_GDI_Grenadier_2SF" },
{ "GDI Havoc", "CnC_GDI_MiniGunner_3Boss" },
{ "GDI Prototype Sydney", "CnC_Sydney_PowerSuit" },
{ "GDI Mobius", "CnC_Ignatio_Mobius" },
{ "GDI Hotwire", "CnC_GDI_Engineer_2SF" },
{ "NOD Officer", "CnC_Nod_Minigunner_1Off" },
{ "NOD Rocket Soldier", "CnC_Nod_RocketSoldier_1Off" },
{ "NOD Chem Warrior", "CnC_Nod_FlameThrower_1Off" },
{ "NOD Blackhand Sniper", "CnC_Nod_Minigunner_2SF" },
{ "NOD Laser Chaingunner", "CnC_Nod_RocketSoldier_2SF" },
{ "NOD Stealth Black Hand", "CnC_Nod_FlameThrower_2SF" },
{ "NOD Sakura", "CnC_Nod_Minigunner_3Boss" },
{ "NOD Raveshaw", "CnC_Nod_RocketSoldier_3Boss" },
{ "NOD Mendoza", "CnC_Nod_FlameThrower_3Boss" },
{ "NOD Technician", "CnC_Nod_Technician_0" }
};
char *RandomNodChar[14][2] = {
{ "NOD Officer", "CnC_Nod_Minigunner_1Off" },
{ "NOD Rocket Soldier", "CnC_Nod_RocketSoldier_1Off" },
{ "NOD Chem Warrior", "CnC_Nod_FlameThrower_1Off" },
{ "NOD Blackhand Sniper", "CnC_Nod_Minigunner_2SF" },
{ "NOD Laser Chaingunner", "CnC_Nod_RocketSoldier_2SF" },
{ "NOD Stealth Black Hand", "CnC_Nod_FlameThrower_2SF" },
{ "NOD Sakura", "CnC_Nod_Minigunner_3Boss" },
{ "NOD Raveshaw", "CnC_Nod_RocketSoldier_3Boss" },
{ "NOD Mendoza", "CnC_Nod_FlameThrower_3Boss" },
{ "NOD Technician", "CnC_Nod_Technician_0" },
{ "GDI Officer", "CnC_GDI_MiniGunner_1Off" },
{ "GDI Rocket Soldier", "CnC_GDI_RocketSoldier_1Off" },
{ "GDI Sydney", "CnC_Sydney" },
{ "GDI Deadeye", "CnC_GDI_MiniGunner_2SF" },
{ "GDI Gunner", "CnC_GDI_RocketSoldier_2SF" },
{ "GDI Patch", "CnC_GDI_Grenadier_2SF" },
{ "GDI Havoc", "CnC_GDI_MiniGunner_3Boss" },
{ "GDI Prototype Sydney", "CnC_Sydney_PowerSuit" },
{ "GDI Mobius", "CnC_Ignatio_Mobius" },
{ "GDI Hotwire", "CnC_GDI_Engineer_2SF" }
};
but the problem is is the message if im on gdi and get a gdi char it whould say somthing like: You have been transformed into a GDI GDI Deadeye by the Random Character Crate.
or somthing like this if im on nod and get a gdi char
You have been transformed into a NOD GDI Deadeye by the Random Character Crate.
and the other way round i tryed not adding the GDI and NOD in front of the names but it then whould say u got a GDI officer and it whould be a nod officer
if anyone understand waht i mean can anyone please help me?
|
|
|
Re: Random Char Error I need Fixed [message #270344 is a reply to message #270219] |
Tue, 03 July 2007 02:26 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
{ "GDI Officer", "CnC_GDI_MiniGunner_1Off" },
The bold part is not needed. It isn't a preset name, it is just part of the console_input msg string. You could infact change it to:
{ "waste of space", "CnC_GDI_MiniGunner_1Off" },
And the server would pm you something like "You have been transformed into a GDI waste of space".
It doesn't matter that the same text might be in the Nod character array, it is in quotation marks and will not confuse it at all.
|
|
|
Re: Random Char Error I need Fixed [message #270346 is a reply to message #270219] |
Tue, 03 July 2007 02:30 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
i know but see nod and gdi both have officer,and engineer and i dont want it to say : you have just been transforms into a GDI officer but infact ur a nod officer
|
|
|
Re: Random Char Error I need Fixed [message #270349 is a reply to message #270219] |
Tue, 03 July 2007 02:33 |
|
Whitedragon
Messages: 832 Registered: February 2003 Location: California
Karma: 1
|
Colonel |
|
|
You're not allocating enough space for the arrays.
char *RandomNodChar[14][2]
See the 14? That's how many entries there are. There's more than 14.
Also, if you're going to let them get the other team's characters then there's no reason to have 2 arrays. Just use the same array for both teams.
Black-Cell.net
Network Administrator (2003 - )
DragonServ, Renegade's first IRC interface bot
Creator and lead coder (2002 - )
Dragonade, Renegade's first server side modification
Lead coder (2005 - )
|
|
|
|
Re: Random Char Error I need Fixed [message #270353 is a reply to message #270219] |
Tue, 03 July 2007 02:39 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
He won't be able to figure out how to make it just read from one array. This way is clumsy but it will work for him.
There is a text string in the code somewhere that will say something like "you have been transformed into", search for that. On that line it will say GDI in there followed by a %s. Remove the word GDI, now do the same for the line containing the word "Nod". It will now work how you want it.
And yeah, WD is right about the 14, you need to change that to how many characters you have in that array.
char *RandomGDIChar[20][2] = {
[Updated on: Tue, 03 July 2007 02:51] Report message to a moderator
|
|
|
|
|
Re: Random Char Error I need Fixed [message #270357 is a reply to message #270219] |
Tue, 03 July 2007 02:46 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
cool ill change it on my ssgm scripts ty
edit: ok maybe im not as smart as i thought i was
StrFormat2(message2,"%ls picked up a Random Character Crate.",Get_Wide_Player_Name(sender));
if (Commands->Get_Player_Type(sender) == 1) {
Change_Character(sender,RandomGDIChar[Index][1]);
StrFormat2(message1,"ppage %d [Crate] You have been transformed into a %s by the Random Character Crate.",Get_Player_ID(sender),RandomGDIChar[Index][0]);
if (Settings->Gamelog) {
Vector3 pos = Commands->Get_Position(sender);
StrFormat2(message3,"CRATE;CHARACTER;%s;%d;%s;%f;%f;%f;%f;%f;%f;%d", RandomGDIChar[Index][0], Commands->Get_ID(sender), Commands->Get_Preset_Name(sender), pos.Y,pos.X,pos.Z, Commands->Get_Facing(sender), Commands->Get_Max_Health(sender),Commands->Get_Max_Shield_Strength(sender),Get_Object_Type(sender));
}
}
else {
Change_Character(sender,RandomNodChar[Index][1]);
StrFormat2(message1,"ppage %d [Crate] You have been transformed into a %s by the Random Character Crate.",Get_Player_ID(sender),RandomNodChar[Index][0]);
if (Settings->Gamelog) {
Vector3 pos = Commands->Get_Position(sender);
StrFormat2(message3,"CRATE;CHARACTER;%s;%d;%s;%f;%f;%f;%f;%f;%f;%d", RandomNodChar[Index][0], Commands->Get_ID(sender), Commands->Get_Preset_Name(sender), pos.Y,pos.X,pos.Z, Commands->Get_Facing(sender), Commands->Get_Max_Health(sender),Commands->Get_Max_Shield_Strength(sender),Get_Object_Type(sender));
}
now what do i have to change>? i have a idea but not 100% sure
[Updated on: Tue, 03 July 2007 02:48] Report message to a moderator
|
|
|
|
|
|
Re: Random Char Error I need Fixed [message #270361 is a reply to message #270219] |
Tue, 03 July 2007 02:54 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
o where u said
"There is a text string in the code somewhere that will say something like "you have been transformed into", search for that. On that line it will say GDI in there followed by a %s. Remove the word GDI, now do the same for the line containing the word "Nod". It will now work how you want it."
idk if im looking at the rigth spot so see the section of the code wher ei posted where do i edit it at?
srry i know im noobish at this
|
|
|
Re: Random Char Error I need Fixed [message #270362 is a reply to message #270219] |
Tue, 03 July 2007 03:01 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
I thought I remembered it being here:
StrFormat2(message1,"ppage %d [Crate] You have been transformed into a %s by the Random Character Crate.",Get_Player_ID(sender),RandomNodChar[Index][0]);
Although that was in SSAOW 1.5, this version doesn't seem to have it there. I am at work ATM and can't really spend much time looking for you.
|
|
|
|
Goto Forum:
Current Time: Fri Dec 20 21:54:37 MST 2024
Total time taken to generate the page: 0.00912 seconds
|