|
Re: Base Defense Team Change [message #331040 is a reply to message #330814] |
Sun, 18 May 2008 13:08 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
can u make and attach a building controller to a models bone with a chat hook command?
and also reborn im getting this form tis
class teleChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj_By_Player_Name(Text[0].c_str());
RequestSpawn(obj);
}
};
ChatCommandRegistrant<teleChatCommand> teleChatCommandReg("!tele",CHATTYPE_ALL,0,GAMEMODE_ALL);
Quote: |
1>.\gmmain.cpp(2179) : error C3861: 'RequestSpawn': identifier not found
1>Build log was saved at "file://c:\Users\Lil Blueyes\Desktop\SSGM Source\SSGM Source\tmp\scripts\debug\BuildLog.htm"
1>SSGM - 1 error(s), 0 warning(s)
and
1>gmmain.cpp
1>.\gmmain.cpp(2182) : error C2065: 'Spawn1OK' : undeclared identifier
1>.\gmmain.cpp(2184) : error C2065: 'Spawn1OK' : undeclared identifier
1>.\gmmain.cpp(2191) : error C2065: 'Spawn2OK' : undeclared identifier
1>.\gmmain.cpp(2192) : error C2065: 'Spawn2OK' : undeclared identifier
1>.\gmmain.cpp(2198) : error C2065: 'Spawn3OK' : undeclared identifier
1>.\gmmain.cpp(2199) : error C2065: 'Spawn3OK' : undeclared identifier
1>.\gmmain.cpp(2217) : error C2065: 'Spawn1OK' : undeclared identifier
1>.\gmmain.cpp(2219) : error C2065: 'Spawn1OK' : undeclared identifier
1>.\gmmain.cpp(2226) : error C2065: 'Spawn2OK' : undeclared identifier
1>.\gmmain.cpp(2227) : error C2065: 'Spawn2OK' : undeclared identifier
1>.\gmmain.cpp(2233) : error C2065: 'Spawn3OK' : undeclared identifier
1>.\gmmain.cpp(2234) : error C2065: 'Spawn3OK' : undeclared identifier
1>.\gmmain.cpp(2258) : error C2065: 'Spawn1OK' : undeclared identifier
1>.\gmmain.cpp(2259) : error C2065: 'Spawn2OK' : undeclared identifier
1>.\gmmain.cpp(2260) : error C2065: 'Spawn3OK' : undeclared identifier
|
[Updated on: Sun, 18 May 2008 13:31] Report message to a moderator
|
|
|
Re: Base Defense Team Change [message #331049 is a reply to message #330814] |
Sun, 18 May 2008 14:34 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
Add this:
bool Spawn1OK = true;
bool Spawn2OK = true;
bool Spawn3OK = true;
Under here:
#include <time.h>
#include <fstream>
using namespace std;
#include <stdarg.h>
#include "scripts.h"
#include "date.h"
#include "engine.h"
#include "gmmain.h"
#ifdef WIN32
#include <ddeml.h>
#else
#include <dlfcn.h>
#endif
bool OkLoad = false;
#ifndef WIN32
extern void *bhs;
UnloaderClass Unloader;
#endif
DataStruct *Data = 0;
SettingsStruct *Settings = 0;
in gmmain.cpp, then compile it.
|
|
|
|
|
Re: Base Defense Team Change [message #331059 is a reply to message #331054] |
Sun, 18 May 2008 15:20 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
reborn wrote on Sun, 18 May 2008 15:04 | If you want to, yeah sure.
|
and the code u JUST posted above does that goes with the script correct?
|
|
|
|
|
Re: Base Defense Team Change [message #331096 is a reply to message #330814] |
Sun, 18 May 2008 20:51 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
it works expect takes me to 0,0,0 after putting int he 3 random spots but idk why thats so......ether way ut works great....
another thing that !info command what other info can u add?
i tried to add 5 new ones until i release they were not constant char lol
|
|
|
Re: Base Defense Team Change [message #331100 is a reply to message #331096] |
Sun, 18 May 2008 22:14 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
SSnipe wrote on Sun, 18 May 2008 23:51 | it works expect takes me to 0,0,0 after putting int he 3 random spots but idk why thats so......ether way ut works great....
another thing that !info command what other info can u add?
i tried to add 5 new ones until i release they were not constant char lol
|
You can add all types of info, there's too much to list.
It should not be moving you to 0,0,0, not if you have changed all three random spawn positions.
|
|
|
Re: Base Defense Team Change [message #331101 is a reply to message #331100] |
Sun, 18 May 2008 22:18 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
reborn wrote on Sun, 18 May 2008 22:14 |
SSnipe wrote on Sun, 18 May 2008 23:51 | it works expect takes me to 0,0,0 after putting int he 3 random spots but idk why thats so......ether way ut works great....
another thing that !info command what other info can u add?
i tried to add 5 new ones until i release they were not constant char lol
|
You can add all types of info, there's too much to list.
It should not be moving you to 0,0,0, not if you have changed all three random spawn positions.
|
i guess ill have to find out how to add other infos that arnt
constant char
and reborn i just copied and pasted and changed the x,y,z int he 3 spots
|
|
|
|
|
Re: Base Defense Team Change [message #331126 is a reply to message #330814] |
Mon, 19 May 2008 01:58 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
ok i done it more and found out its not working right....i type it maybe like once out of 15 times i get teleported...but rest of tiem i go to 0,0,0
does this have anything to do with it?
Refresh = Commands->Create_Object("Invisible_Object",Vector3(0.0f,0.0f,0.0f));
[Updated on: Mon, 19 May 2008 02:01] Report message to a moderator
|
|
|
Re: Base Defense Team Change [message #331129 is a reply to message #330814] |
Mon, 19 May 2008 02:22 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
No, that's just creating an object for the KAK_ script to be attached to.
It's possible that the refresh script is screwing things up.
Try commenting out these lines:
/*
Refresh = Commands->Create_Object("Invisible_Object",Vector3(0.0f,0.0f,0.0f));
char param[5];
sprintf(param,"%d",RandomSpawn);
Commands->Attach_Script(Refresh,"KAK_DM_Refresh_Spawn",param);
*/
See what happens.
|
|
|
Re: Base Defense Team Change [message #331210 is a reply to message #330814] |
Mon, 19 May 2008 15:25 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
i did that and still having the problem im going to the 0,0,0
also how can i change the info command to send A PM to the person who did the command on a player?
like
SSnipe !info ren00b
then pms me his info
i got the part to use the command ON a player
GameObject *obj = Get_GameObj_By_Player_Name(Text[1].c_str());
and changed it to
Console_Input(StrFormat("ppage
but not working
|
|
|
|
|
Re: Base Defense Team Change [message #333755 is a reply to message #330966] |
Fri, 06 June 2008 23:27 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
reborn wrote on Sun, 18 May 2008 03:11 |
void RequestSpawn(GameObject *obj) {
int RandomSpawn = Commands->Get_Random_Int(1,33);
Vector3 NewPos;
Spawn:
if (strcmp(The_Game()->MapName, "C&C_Under.mix") == 0) {
if (RandomSpawn == 1 && Spawn1OK == true) {
Spawn1OK = false;
NewPos.X = 0.0f;
NewPos.Y = 0.0f;
NewPos.Z = 0.0f;
}
else if (RandomSpawn == 2 && Spawn2OK == true) {
Spawn2OK = false;
NewPos.X = 0.0f;
NewPos.Y = 0.0f;
NewPos.Z = 0.0f;
}
else if (RandomSpawn == 3 && Spawn3OK == true) {
Spawn3OK = false;
NewPos.X = 0.0f;
NewPos.Y = 0.0f;
NewPos.Z = 0.0f;
}
GameObject *Refresh;
Refresh = Commands->Create_Object("Invisible_Object",Vector3(0.0f,0.0f,0.0f));
char param[5];
sprintf(param,"%d",RandomSpawn);
Commands->Attach_Script(Refresh,"KAK_DM_Refresh_Spawn",param);
Commands->Set_Position(obj,NewPos);
}
else if (strcmp(The_Game()->MapName, "C&C_someothermap.mix") == 0) {
if (RandomSpawn == 1 && Spawn1OK == true) {
Spawn1OK = false;
NewPos.X = 0.0f;
NewPos.Y = 0.0f;
NewPos.Z = 0.0f;
}
else if (RandomSpawn == 2 && Spawn2OK == true) {
Spawn2OK = false;
NewPos.X = 0.0f;
NewPos.Y = 0.0f;
NewPos.Z = 0.0f;
}
else if (RandomSpawn == 3 && Spawn3OK == true) {
Spawn3OK = false;
NewPos.X = 0.0f;
NewPos.Y = 0.0f;
NewPos.Z = 0.0f;
}
GameObject *Refresh;
Refresh = Commands->Create_Object("Invisible_Object",Vector3(0.0f,0.0f,0.0f));
char param[5];
sprintf(param,"%d",RandomSpawn);
Commands->Attach_Script(Refresh,"KAK_DM_Refresh_Spawn",param);
Commands->Set_Position(obj,NewPos);
}
}
void KAK_DM_Refresh_Spawn::Created(GameObject *obj) {
Commands->Start_Timer(obj,this,5.0f,Get_Int_Parameter("SpawnNum"));
}
void KAK_DM_Refresh_Spawn::Timer_Expired(GameObject *obj, int number) {
if (number == 1) Spawn1OK = true;
else if (number == 2) Spawn2OK = true;
else if (number == 3) Spawn3OK = true;
Commands->Destroy_Object(obj);
}
class KAK_DM_Refresh_Spawn : public ScriptImpClass {
void Created(GameObject *obj);
void Timer_Expired(GameObject *obj, int number);
};
ScriptRegistrant<KAK_DM_Refresh_Spawn> KAK_DM_Refresh_Spawn_Registrant("KAK_DM_Refresh_Spawn","SpawnNum=0:int");
class teleChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
RequestSpawn(obj);
}
};
ChatCommandRegistrant<teleChatCommand> teleChatCommandReg("!tele",CHATTYPE_ALL,0,GAMEMODE_ALL);
You will need to change the places it can spawn to, instead of 0,0,0, you can get these values from level edit, but I prefer to walk around ingame and decide for myself, when making allot I find it's quicker anyway...
Use this chat hook to get the precise floating point values for where you're standing (also gives some other info too, but don't worry about that).
class infoChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
const char *preset = Commands->Get_Preset_Name(obj);
const char *model = Get_Model(obj);
const char *weapon = Get_Current_Weapon(obj);
const char *shield = Get_Shield_Type(obj);
const char *skin = Get_Skin(obj);
Vector3 CurPosition = Commands->Get_Position(obj);
Console_Input(StrFormat("msg Character preset name is: %s",preset).c_str());
Console_Input(StrFormat("msg Character model name is: %s",model).c_str());
Console_Input(StrFormat("msg The preset name of the weapon is: %s",weapon).c_str());
Console_Input(StrFormat("msg The shield type is: %s",shield).c_str());
Console_Input(StrFormat("msg The skin type is: %s",skin).c_str());
Console_Input(StrFormat("msg NewPos.X = %ff;",CurPosition.X).c_str());
Console_Input(StrFormat("msg NewPos.Y = %ff;",CurPosition.Y).c_str());
Console_Input(StrFormat("msg NewPos.Z = %ff;",CurPosition.Z).c_str());
}
};
ChatCommandRegistrant<infoChatCommand> infoChatCommandReg("!info",CHATTYPE_TEAM,0,GAMEMODE_ALL);
That should make you spawn in any three random places based on whatever map you're on. You can easily extend it for as many maps as needed.
|
reborn think you can find out why i always go to 0,0,0?
|
|
|