Ingame Error? [message #273263] |
Sat, 14 July 2007 20:14 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
im testing my code to teleport me to the single flar
class testChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
if (Is_Mod("Test_Mods.txt",Get_Player_Name_By_ID(ID))) {
GameObject *obj = Get_GameObj_By_Player_Name(Text[1].c_str());
Change_Character(obj,"GDI_MP");
Commands->Attach_Script(obj,"JFW_Permanent_No_Falling_Damage",false);
Commands->Give_Powerup(obj,"CnC_POW_AutoRifle_Player_GDI",false);
Commands->Attach_Script(obj,"JFW_Permanent_No_Falling_Damage",false);
SimpleDynVecClass<GameObject*> List = Get_All_Objects_By_Preset(2,"Signal_Flares");
int Rand = Commands->Get_Random_Int(0,List.Count());
GameObject *RandObj = List[Rand];
Commands->Set_Position(obj,Commands->Get_Position(RandObj));;
Vector3 Pos = Commands->Get_Position(obj);
Pos.Z += 0.710;
}
}
};
NOTE i added the Vector3 Pos = Commands->Get_Position(obj);
Pos.Z += 0.710;
myself to maybe fix it
well besides that the error i get is this ingame is this
and this is how it is in lvl and idk how to fix it iv tryed all i know
|
|
|
|
Re: Ingame Error? [message #273273 is a reply to message #273263] |
Sat, 14 July 2007 21:17 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
i have trued riasing it to the roof and yet stil did whats in the first screenshot
|
|
|
|
|
Re: Ingame Error? [message #273299 is a reply to message #273263] |
Sun, 15 July 2007 01:31 |
a100
Messages: 45 Registered: March 2007
Karma: 0
|
Recruit |
|
|
Are you sure they have enabled collision properties?
PS. Looking at the code, dont continuasly open the file and read from it everytime the command is called on because it will lag the server and will crash it sometimes. Or atleast thats what happned to me.
[Updated on: Sun, 15 July 2007 01:42] Report message to a moderator
|
|
|
Re: Ingame Error? [message #273334 is a reply to message #273299] |
Sun, 15 July 2007 05:56 |
dead6re
Messages: 602 Registered: September 2003
Karma: 0
|
Colonel |
|
|
a100 wrote on Sun, 15 July 2007 04:31 | Are you sure they have enabled collision properties?
PS. Looking at the code, dont continuasly open the file and read from it everytime the command is called on because it will lag the server and will crash it sometimes. Or atleast thats what happned to me.
|
Opening/Closing a file won't crash your server. I always did that until I wrote my "cache ini class".
class testChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
if (Is_Mod("Test_Mods.txt",Get_Player_Name_By_ID(ID))) {
GameObject *obj = Get_GameObj(ID); // Gets GameObj using Player ID
Change_Character(obj, "GDI_MP");
Commands->Attach_Script(obj, "JFW_Permanent_No_Falling_Damage", ""); // Prevent obj from recieving falling damage
Commands->Give_Powerup(obj,"CnC_POW_AutoRifle_Player_GDI", ""); // Give GDI Auto Rifle
SimpleDynVecClass<GameObject*> List = Get_All_Objects_By_Preset(2,"Signal_Flares"); // Get a list of all the flares (MAKE SURE THE TEAM IS SET TO 2! WILL NOT WORK OTHERWISE)
int id = Commands->Get_Random_Int(0, List.Count()-1) // C++ always starts at 0, not 1 therefore -1 :)
GameObject *RandObj = List[id]; // Pick the GameObj
Commands->Set_Position(obj, Commands->Get_Position(RandObj)); // Move the position of your GameObj to the flare!
}
else {
char Bad[256];
sprintf(Bad, "ppage %d You do not have access to this command", ID);
Console_Input(Bad);
}
}
}
Let all your wishes be granted except one, so you will still have something to strieve for.
|
|
|
|
Re: Ingame Error? [message #273454 is a reply to message #273299] |
Sun, 15 July 2007 15:44 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
a100 wrote on Sun, 15 July 2007 03:31 | Are you sure they have enabled collision properties?
|
also how i do that
|
|
|
|
Re: Ingame Error? [message #273561 is a reply to message #273299] |
Mon, 16 July 2007 02:00 |
a100
Messages: 45 Registered: March 2007
Karma: 0
|
Recruit |
|
|
Quote: | Opening/Closing a file won't crash your server. I always did that until I wrote my "cache ini class".
|
Well it lags your server alot. But it may just be me.
@Joe It's in leveledit. Click mod object and it should be somewhere there.
[Updated on: Mon, 16 July 2007 02:02] Report message to a moderator
|
|
|
|
Re: Ingame Error? [message #273587 is a reply to message #273263] |
Mon, 16 July 2007 04:48 |
dead6re
Messages: 602 Registered: September 2003
Karma: 0
|
Colonel |
|
|
I thought that Renegade had an engine call for collisions too, something like (but not sure):
Commands->Enable_Collisions(GameObj);
a100: Sounds like something is malformed or you have leaks.
Let all your wishes be granted except one, so you will still have something to strieve for.
|
|
|
Re: Ingame Error? [message #273631 is a reply to message #273263] |
Mon, 16 July 2007 09:37 |
dead6re
Messages: 602 Registered: September 2003
Karma: 0
|
Colonel |
|
|
Sorry, but I would have liked not to double post but, I'm sorry joe but I cannot read your private messages. They are blocked for me for an unknown reason.
Let all your wishes be granted except one, so you will still have something to strieve for.
|
|
|
Re: Ingame Error? [message #273676 is a reply to message #273587] |
Mon, 16 July 2007 13:40 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
[quobut what i was trying to say in the code u posted above i cant use that ON another player i tryed a while to do it myself but got errors for like 2 hours and its a codde u use on another player
[Updated on: Mon, 16 July 2007 14:07] Report message to a moderator
|
|
|
Re: Ingame Error? [message #273749 is a reply to message #273263] |
Tue, 17 July 2007 00:55 |
dead6re
Messages: 602 Registered: September 2003
Karma: 0
|
Colonel |
|
|
What errors did you get?
Let all your wishes be granted except one, so you will still have something to strieve for.
|
|
|
Re: Ingame Error? [message #273750 is a reply to message #273749] |
Tue, 17 July 2007 00:57 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
dead6re wrote on Tue, 17 July 2007 09:55 | What errors did you get?
|
well im trying to get the command to work on a player like do the code and command on THEM and them get the ppage but i got stupid errors
|
|
|
|
Re: Ingame Error? [message #273847 is a reply to message #273843] |
Tue, 17 July 2007 10:47 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
dead6re wrote on Tue, 17 July 2007 18:42 | What code do you have?
|
i tryed to make it so u can use the command on another player but failed
class testChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
if (Is_Mod("Test_Mods.txt",Get_Player_Name_By_ID(ID))) {
GameObject *obj = Get_GameObj(ID); // Gets GameObj using Player ID
Change_Character(obj, "GDI_MP");
Commands->Attach_Script(obj, "JFW_Permanent_No_Falling_Damage", ""); // Prevent obj from recieving falling damage
Commands->Give_Powerup(obj,"CnC_POW_AutoRifle_Player_GDI", ""); // Give GDI Auto Rifle
SimpleDynVecClass<GameObject*> List = Get_All_Objects_By_Preset(2,"Signal_Flares"); // Get a list of all the flares (MAKE SURE THE TEAM IS SET TO 2! WILL NOT WORK OTHERWISE)
int id = Commands->Get_Random_Int(0, List.Count()-1) // C++ always starts at 0, not 1 therefore -1 :)
GameObject *RandObj = List[id]; // Pick the GameObj
Commands->Set_Position(obj, Commands->Get_Position(RandObj)); // Move the position of your GameObj to the flare!
}
else {
char Bad[256];
sprintf(Bad, "ppage %d You do not have access to this command", ID);
Console_Input(Bad);
}
}
}
|
|
|
Re: Ingame Error? [message #273956 is a reply to message #273263] |
Wed, 18 July 2007 00:11 |
dead6re
Messages: 602 Registered: September 2003
Karma: 0
|
Colonel |
|
|
Oh sorry, My code was to act on yourself.
class testChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
if (Is_Mod("Test_Mods.txt",Get_Player_Name_By_ID(ID))) {
Get_GameObj_By_Player_Name(Text[1].c_str()); // Gets GameObj using Player Name
Change_Character(obj, "GDI_MP");
Commands->Attach_Script(obj, "JFW_Permanent_No_Falling_Damage", ""); // Prevent obj from recieving falling damage
Commands->Give_Powerup(obj,"CnC_POW_AutoRifle_Player_GDI", ""); // Give GDI Auto Rifle
SimpleDynVecClass<GameObject*> List = Get_All_Objects_By_Preset(2,"Signal_Flares"); // Get a list of all the flares (MAKE SURE THE TEAM IS SET TO 2! WILL NOT WORK OTHERWISE)
int id = Commands->Get_Random_Int(0, List.Count()-1) // C++ always starts at 0, not 1 therefore -1 :)
GameObject *RandObj = List[id]; // Pick the GameObj
Commands->Set_Position(obj, Commands->Get_Position(RandObj)); // Move the position of your GameObj to the flare!
}
else {
char Bad[256];
sprintf(Bad, "ppage %d You do not have access to this command", ID);
Console_Input(Bad);
}
}
}
Let all your wishes be granted except one, so you will still have something to strieve for.
[Updated on: Wed, 18 July 2007 00:11] Report message to a moderator
|
|
|
Re: Ingame Error? [message #273970 is a reply to message #273263] |
Wed, 18 July 2007 01:05 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
ty i had somthing like this when i tryed but had bunch of fucked up parts :S
|
|
|