Home » Renegade Discussions » Mod Forum » START_TIMER Parameters
START_TIMER Parameters [message #434519] |
Tue, 10 August 2010 17:58 |
|
T0tNl
Messages: 63 Registered: July 2007
Karma: 0
|
Recruit |
|
|
Here's just a example I found on the forums. I'm wondering what the parameter's are respectively for this statement?:
Commands->start_timer(obj,this,2.0f,2);
Second question is I've noticed in the chat hook when I use set_model, their is an "animation freeze" in the character:
[img]http://img844.imageshack.us/img844/4987/animationfreeze.jpg[/img]
I believe I need to setup a timer, between the time it change's from it's original preset to another preset. I'm a rookie with c++ so I'm wondering if someone can show me?
I think I need a created event and also a timer_expired event, I'm not sure what .cpp should they go in>?
[Updated on: Tue, 10 August 2010 20:03] Report message to a moderator
|
|
|
|
Re: START_TIMER Parameters [message #434529 is a reply to message #434528] |
Tue, 10 August 2010 22:39 |
|
T0tNl
Messages: 63 Registered: July 2007
Karma: 0
|
Recruit |
|
|
Thank you for your response, I have checked and no where is RR even on this pc.
If you don't mind sharing but where do created events and expired event's go and in what .cpp. I'm trying to use them for a timer from switching from your current character preset to setting it to a model to one of the "Hidden" models in renegade.
I checked again, I cannot find any global functions or event's that have "this" in their parameters.
I needed this for:
void Timer::Created(GameObject *obj) {
Commands->Start_Timer(obj,this,40.0f,1);
}
I also don't know where to place my "Timer_Expired" script either.
[Updated on: Tue, 10 August 2010 23:22] Report message to a moderator
|
|
|
Re: START_TIMER Parameters [message #434536 is a reply to message #434519] |
Wed, 11 August 2010 00:20 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
I am happy to help, but you do not need to create a timer to change their model. You could over come this "Jesus position" problem by changing their preset, and then granting them the same health, armor, weapons and ammo as their previous character.
This would make it appear a transitional change, rather than a state.
|
|
|
Re: START_TIMER Parameters [message #434541 is a reply to message #434519] |
Wed, 11 August 2010 02:44 |
|
Omar007
Messages: 1711 Registered: December 2007 Location: Amsterdam
Karma: 0
|
General (1 Star) |
|
|
You indeed don't need a timer for that. Though if you are still interested here is a little example for the timer.
This script shows 2 timers in one.
Header
class MyTimerScript : public ScriptImpClass
{
void Created(GameObject *obj);
//'GameObject *obj' is the gameobject the script runs on
void Timer_Expired(GameObject *obj, int number);
//obj see above
//'int number' takes an int value that you can use to check which timer ended.
};
CPP
#include "engine.h"
#include "scripts.h"
#include "MyTimerScript.h"
void MyTimerScript::Created(GameObject *obj)
{
Commands->Start_Timer(obj, this, 10.0f, 1);
//param 1 (obj) = object to run the timer on
//param 2 (this) = a ScriptImpClass class or sub-class (in the header you extended ScriptImpClass so 'this' is a sub-class)
//param 3 (10.0f) = time in seconds before the timer expires
//param 4 (1) = number used to check which timer ended (timer ID)
Commands->Start_Timer(obj, this, 20.0f, 2);
//param 1 (obj) = see above
//param 2 (this) = see above
//param 3 (20.0f) = see above
//param 4 (2) = see above (number is now 2 so this timer ID is different from the previous one)
}
void MyTimerScript::Timer_Expired(GameObject *obj, int number)
{
if(number == 1) //if timer with number (ID) 1 ended (the 10 second timer)
{
//Do stuff
}
else if(number == 2) //else, if timer with number (ID) 2 ended (the 20 second timer)
{
//Do other stuff
}
}
I hope this clears thing up. And you dont have to make scripts in existing CPP or H files. You can add your own. Making your own and adding the above code should work immediately (if you name the header file 'MyTimerScript.h' in this case)
[Updated on: Wed, 11 August 2010 03:00] Report message to a moderator
|
|
|
Re: START_TIMER Parameters [message #434583 is a reply to message #434519] |
Wed, 11 August 2010 12:50 |
|
T0tNl
Messages: 63 Registered: July 2007
Karma: 0
|
Recruit |
|
|
Thank you both of you, and thank's Omar, for clarifying that.
This does not seem to work, for a apperant reason . . . .
I also noticed reborn mentioned a way but I'm not to sure on how to do the "transtion" . If I use the change_character function then set_model it won't set the model to the desired model I want it'll only change the character.
.h code class MyTimerScript : public ScriptImpClass
{
void Created(GameObject *obj);
Commands->Start_Timer(obj, this, 1.0f, 1);
void Timer_Expired(GameObject *obj, int number);
{
if(number == 1) //if timer with number (ID) 1 ended (the 10 second timer)
{
Commands->Set_Model(obj, "clown");
}
};
gmmain.cpp chat hook code
class testChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
float Credits = Commands->Get_Money(obj);
int Team = Get_Object_Type(obj);
Vector3 position;
position = Commands->Get_Position(obj);
{
if(Credits >= 10 && (Team == 0) ){
Commands->Give_Money(obj,-10,false);
char message[256];
sprintf(message,"msg %s has bought a test character.", Get_Player_Name_By_ID(ID));
Console_Input(message);
Commands->Attach_Script(obj, "MyTimerScript" , "");
Commands->Set_Position(obj,position);
}
else{
Console_Input(StrFormat("ppage %d You need 10 credits for this selection!.",Get_Player_ID(obj)).c_str());
}
}
}
};
ChatCommandRegistrant<testChatCommand> testChatCommandReg("!test",CHATTYPE_ALL,0,GAMEMODE_AOW);
I really don't know what's wronge maybe I'm not attaching it correctly :L
[Updated on: Wed, 11 August 2010 12:51] Report message to a moderator
|
|
|
Re: START_TIMER Parameters [message #434585 is a reply to message #434519] |
Wed, 11 August 2010 13:54 |
|
Omar007
Messages: 1711 Registered: December 2007 Location: Amsterdam
Karma: 0
|
General (1 Star) |
|
|
Instead of using Set_Model he wants you to change the preset and then set the health/shield/weapons to that of the previous preset.
Here is an example of what he means (i think (only CPP)).
void MySwapCharScript::Created(GameObject *obj)
{
int maxH = Commands->Get_Max_Health(obj);
int curH = Commands->Get_Health(obj);
int maxS = Commands->Get_Max_Shield_Strength(obj);
int curS = Commands->Get_Shield_Strength(obj);
Change_Character(obj, "clown"); //Change preset
Commands->Set_Max_Health(maxH); //Set max health to that of the previous preset
Commands->Set_Health(curH); //Set health to that of the previous preset
Commands->Set_Max_Shield_Strength(maxS); //Set max shield to that of the previous preset
Commands->Set_Shield_Strength(curS); //Set shield to that of the previous preset
}
NOTE: this is only what I think he means. I can't look into his head
Also I'm not 100% sure this code is flawless as I do this on memorized info.
[Updated on: Wed, 11 August 2010 14:03] Report message to a moderator
|
|
|
Re: START_TIMER Parameters [message #434594 is a reply to message #434519] |
Wed, 11 August 2010 15:42 |
|
T0tNl
Messages: 63 Registered: July 2007
Karma: 0
|
Recruit |
|
|
1>------ Build started: Project: SSGM, Configuration: Debug Win32 ------
1>Compiling...
1>MySwapCharScript.cpp
1>.\MySwapCharScript.cpp(1) : error C2653: 'MySwapCharScript' : is not a class or namespace name
1>.\MySwapCharScript.cpp(1) : error C2065: 'GameObject' : undeclared identifier
1>.\MySwapCharScript.cpp(1) : error C2065: 'obj' : undeclared identifier
1>.\MySwapCharScript.cpp(2) : error C2448: 'Created' : function-style initializer appears to be a function definition
1>Creating browse information file...
1>Microsoft Browse Information Maintenance Utility Version 8.00.50727
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Build log was saved at "file://c:\Westwood\RenegadeFDS\Server\New Folder\tmp\scripts\debug\BuildLog.htm"
1>SSGM - 4 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
|
|
|
|
Re: START_TIMER Parameters [message #434601 is a reply to message #434598] |
Wed, 11 August 2010 16:18 |
|
T0tNl
Messages: 63 Registered: July 2007
Karma: 0
|
Recruit |
|
|
still:
1>.\MySwapCharScript.cpp(1) : error C2653: 'MySwapCharScript' : is not a class or namespace name
1>.\MySwapCharScript.cpp(1) : error C2065: 'GameObject' : undeclared identifier
1>.\MySwapCharScript.cpp(1) : error C2065: 'obj' : undeclared identifier
1>.\MySwapCharScript.cpp(2) : error C2448: 'Created' : function-style initializer appears to be a function definition
Getting this issue again. Do you mind taking a look?
I have kepth the code that you have posted since mine with the timer's obviousily fail's.
MySwapCharScript.cpp file
#include "engine.h"
#include "scripts.h"
#include "MySwapCharScript.h
void MySwapCharScript::Created(GameObject *obj)
{
int maxH = Commands->Get_Max_Health(obj);
int curH = Commands->Get_Health(obj);
int maxS = Commands->Get_Max_Shield_Strength(obj);
int curS = Commands->Get_Shield_Strength(obj);
Change_Character(obj, "clown"); //Change preset
Commands->Set_Max_Health(maxH); //Set max health to that of the previous preset
Commands->Set_Health(curH); //Set health to that of the previous preset
Commands->Set_Max_Shield_Strength(maxS); //Set max shield to that of the previous preset
Commands->Set_Shield_Strength(curS); //Set shield to that of the previous preset
}
MySwapCharScript.h file
class MySwapCharScript : public ScriptImpClass
{
Created(GameObject *obj);
};
gmmain.cpp
class testChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
float Credits = Commands->Get_Money(obj);
int Team = Get_Object_Type(obj);
Vector3 position;
position = Commands->Get_Position(obj);
{
if(Credits >= 10 && (Team == 0) ){
Commands->Give_Money(obj,-10,false);
char message[256];
Change_Character(obj, "CnC_Nod_FlameThrower_2SF");
Commands->Attach_Script(obj, "MySwapCharScript" , "");
sprintf(message,"msg %s has bought a test character.", Get_Player_Name_By_ID(ID));
Console_Input(message);
Commands->Set_Position(obj,position);
}
else{
Console_Input(StrFormat("ppage %d You need 10 credits for this selection!.",Get_Player_ID(obj)).c_str());
}
}
}
};
ChatCommandRegistrant<testChatCommand> testChatCommandReg("!test",CHATTYPE_ALL,0,GAMEMODE_AOW);
[Updated on: Wed, 11 August 2010 16:59] Report message to a moderator
|
|
|
Re: START_TIMER Parameters [message #434607 is a reply to message #434519] |
Wed, 11 August 2010 16:49 |
|
Omar007
Messages: 1711 Registered: December 2007 Location: Amsterdam
Karma: 0
|
General (1 Star) |
|
|
You did include:
#include "engine.h"
#include "scripts.h"
#include "MySwapCharScript.h"
in the CPP right?
About the int's; the value returned is an integer so why would you want floats?? :S
And seriously, take a look at some existing scripts. It'll help
[Updated on: Wed, 11 August 2010 16:50] Report message to a moderator
|
|
|
Re: START_TIMER Parameters [message #434609 is a reply to message #434607] |
Wed, 11 August 2010 16:57 |
|
T0tNl
Messages: 63 Registered: July 2007
Karma: 0
|
Recruit |
|
|
Please take a look again at the post I posted before you posted I edited ti with my header's and .cpp. The problem was their is no example on this forums literally I could find that could simulate this because most of them were just changing your current preset to another with some new weapons etc.. that was my problem. I had mistakenly deleted my .h for the script so it was causing that error. Now I re-added double checked and I HAVE THE DIRECTIVES defined in .cpp this time. I have a shit load of errors now . lol.For the int part I thought the value returned was a float and we were converting it to a int lol.
1>------ Build started: Project: SSGM, Configuration: Debug Win32 ------
1>Compiling...
1>MySwapCharScript.cpp
1>c:\westwood\renegadefds\server\new folder\engine_math.h(39) : error C2061: syntax error : identifier 'Vector3'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(40) : error C2061: syntax error : identifier 'Vector3'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(41) : error C2061: syntax error : identifier 'Vector3'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(42) : error C2061: syntax error : identifier 'Vector3'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(43) : error C2061: syntax error : identifier 'Vector3'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(43) : error C2535: 'void _Vector3MathFunctions::Multiply(void)' : member function already defined or declared
1> c:\westwood\renegadefds\server\new folder\engine_math.h(41) : see declaration of '_Vector3MathFunctions::Multiply'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(44) : error C2061: syntax error : identifier 'Vector3'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(44) : error C2535: 'void _Vector3MathFunctions::Divide(void)' : member function already defined or declared
1> c:\westwood\renegadefds\server\new folder\engine_math.h(42) : see declaration of '_Vector3MathFunctions::Divide'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(45) : error C2061: syntax error : identifier 'Vector3'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(46) : error C2061: syntax error : identifier 'Vector3'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(47) : error C2061: syntax error : identifier 'Vector3'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(49) : error C2146: syntax error : missing ';' before identifier 'Add'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(49) : error C2433: '_Vector3MathFunctions::Vector3' : 'virtual' not permitted on data declarations
1>c:\westwood\renegadefds\server\new folder\engine_math.h(49) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\westwood\renegadefds\server\new folder\engine_math.h(49) : error C2061: syntax error : identifier 'Vector3'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(49) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\westwood\renegadefds\server\new folder\engine_math.h(49) : error C2556: 'int _Vector3MathFunctions::Add(void)' : overloaded function differs only by return type from 'void _Vector3MathFunctions::Add(void)'
1> c:\westwood\renegadefds\server\new folder\engine_math.h(39) : see declaration of '_Vector3MathFunctions::Add'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(49) : error C2371: '_Vector3MathFunctions::Add' : redefinition; different basic types
1> c:\westwood\renegadefds\server\new folder\engine_math.h(39) : see declaration of '_Vector3MathFunctions::Add'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(49) : warning C4183: 'Add': missing return type; assumed to be a member function returning 'int'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(50) : error C2146: syntax error : missing ';' before identifier 'Subtract'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(50) : error C2433: '_Vector3MathFunctions::Vector3' : 'virtual' not permitted on data declarations
1>c:\westwood\renegadefds\server\new folder\engine_math.h(50) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\westwood\renegadefds\server\new folder\engine_math.h(50) : error C2061: syntax error : identifier 'Vector3'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(50) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\westwood\renegadefds\server\new folder\engine_math.h(50) : error C2556: 'int _Vector3MathFunctions::Subtract(void)' : overloaded function differs only by return type from 'void _Vector3MathFunctions::Subtract(void)'
1> c:\westwood\renegadefds\server\new folder\engine_math.h(40) : see declaration of '_Vector3MathFunctions::Subtract'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(50) : error C2371: '_Vector3MathFunctions::Subtract' : redefinition; different basic types
1> c:\westwood\renegadefds\server\new folder\engine_math.h(40) : see declaration of '_Vector3MathFunctions::Subtract'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(50) : warning C4183: 'Subtract': missing return type; assumed to be a member function returning 'int'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(51) : error C2146: syntax error : missing ';' before identifier 'Multiply'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(51) : error C2433: '_Vector3MathFunctions::Vector3' : 'virtual' not permitted on data declarations
1>c:\westwood\renegadefds\server\new folder\engine_math.h(51) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\westwood\renegadefds\server\new folder\engine_math.h(51) : error C2061: syntax error : identifier 'Vector3'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(51) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\westwood\renegadefds\server\new folder\engine_math.h(51) : error C2556: 'int _Vector3MathFunctions::Multiply(void)' : overloaded function differs only by return type from 'void _Vector3MathFunctions::Multiply(void)'
1> c:\westwood\renegadefds\server\new folder\engine_math.h(41) : see declaration of '_Vector3MathFunctions::Multiply'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(51) : error C2371: '_Vector3MathFunctions::Multiply' : redefinition; different basic types
1> c:\westwood\renegadefds\server\new folder\engine_math.h(41) : see declaration of '_Vector3MathFunctions::Multiply'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(51) : warning C4183: 'Multiply': missing return type; assumed to be a member function returning 'int'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(52) : error C2146: syntax error : missing ';' before identifier 'Divide'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(52) : error C2433: '_Vector3MathFunctions::Vector3' : 'virtual' not permitted on data declarations
1>c:\westwood\renegadefds\server\new folder\engine_math.h(52) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\westwood\renegadefds\server\new folder\engine_math.h(52) : error C2061: syntax error : identifier 'Vector3'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(52) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\westwood\renegadefds\server\new folder\engine_math.h(52) : error C2556: 'int _Vector3MathFunctions::Divide(void)' : overloaded function differs only by return type from 'void _Vector3MathFunctions::Divide(void)'
1> c:\westwood\renegadefds\server\new folder\engine_math.h(42) : see declaration of '_Vector3MathFunctions::Divide'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(52) : error C2371: '_Vector3MathFunctions::Divide' : redefinition; different basic types
1> c:\westwood\renegadefds\server\new folder\engine_math.h(42) : see declaration of '_Vector3MathFunctions::Divide'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(52) : warning C4183: 'Divide': missing return type; assumed to be a member function returning 'int'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(53) : error C2146: syntax error : missing ';' before identifier 'Multiply'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(53) : error C2433: '_Vector3MathFunctions::Vector3' : 'virtual' not permitted on data declarations
1>c:\westwood\renegadefds\server\new folder\engine_math.h(53) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\westwood\renegadefds\server\new folder\engine_math.h(53) : error C2061: syntax error : identifier 'Vector3'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(53) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\westwood\renegadefds\server\new folder\engine_math.h(53) : error C2556: 'int _Vector3MathFunctions::Multiply(void)' : overloaded function differs only by return type from 'void _Vector3MathFunctions::Multiply(void)'
1> c:\westwood\renegadefds\server\new folder\engine_math.h(41) : see declaration of '_Vector3MathFunctions::Multiply'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(53) : warning C4183: 'Multiply': missing return type; assumed to be a member function returning 'int'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(54) : error C2146: syntax error : missing ';' before identifier 'Divide'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(54) : error C2433: '_Vector3MathFunctions::Vector3' : 'virtual' not permitted on data declarations
1>c:\westwood\renegadefds\server\new folder\engine_math.h(54) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\westwood\renegadefds\server\new folder\engine_math.h(54) : error C2061: syntax error : identifier 'Vector3'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(54) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\westwood\renegadefds\server\new folder\engine_math.h(54) : error C2556: 'int _Vector3MathFunctions::Divide(void)' : overloaded function differs only by return type from 'void _Vector3MathFunctions::Divide(void)'
1> c:\westwood\renegadefds\server\new folder\engine_math.h(42) : see declaration of '_Vector3MathFunctions::Divide'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(54) : warning C4183: 'Divide': missing return type; assumed to be a member function returning 'int'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(55) : error C2146: syntax error : missing ';' before identifier 'Cross'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(55) : error C2433: '_Vector3MathFunctions::Vector3' : 'virtual' not permitted on data declarations
1>c:\westwood\renegadefds\server\new folder\engine_math.h(55) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\westwood\renegadefds\server\new folder\engine_math.h(55) : error C2061: syntax error : identifier 'Vector3'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(55) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\westwood\renegadefds\server\new folder\engine_math.h(55) : error C2556: 'int _Vector3MathFunctions::Cross(void)' : overloaded function differs only by return type from 'void _Vector3MathFunctions::Cross(void)'
1> c:\westwood\renegadefds\server\new folder\engine_math.h(45) : see declaration of '_Vector3MathFunctions::Cross'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(55) : error C2371: '_Vector3MathFunctions::Cross' : redefinition; different basic types
1> c:\westwood\renegadefds\server\new folder\engine_math.h(45) : see declaration of '_Vector3MathFunctions::Cross'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(55) : warning C4183: 'Cross': missing return type; assumed to be a member function returning 'int'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(56) : error C2146: syntax error : missing ';' before identifier 'Normalize'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(56) : error C2433: '_Vector3MathFunctions::Vector3' : 'virtual' not permitted on data declarations
1>c:\westwood\renegadefds\server\new folder\engine_math.h(56) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\westwood\renegadefds\server\new folder\engine_math.h(56) : error C2061: syntax error : identifier 'Vector3'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(56) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\westwood\renegadefds\server\new folder\engine_math.h(56) : error C2556: 'int _Vector3MathFunctions::Normalize(void)' : overloaded function differs only by return type from 'void _Vector3MathFunctions::Normalize(void)'
1> c:\westwood\renegadefds\server\new folder\engine_math.h(46) : see declaration of '_Vector3MathFunctions::Normalize'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(56) : error C2371: '_Vector3MathFunctions::Normalize' : redefinition; different basic types
1> c:\westwood\renegadefds\server\new folder\engine_math.h(46) : see declaration of '_Vector3MathFunctions::Normalize'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(56) : warning C4183: 'Normalize': missing return type; assumed to be a member function returning 'int'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(57) : error C2061: syntax error : identifier 'Vector3'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(57) : error C2556: 'float _Vector3MathFunctions::Dot(void)' : overloaded function differs only by return type from 'void _Vector3MathFunctions::Dot(void)'
1> c:\westwood\renegadefds\server\new folder\engine_math.h(47) : see declaration of '_Vector3MathFunctions::Dot'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(57) : error C2371: '_Vector3MathFunctions::Dot' : redefinition; different basic types
1> c:\westwood\renegadefds\server\new folder\engine_math.h(47) : see declaration of '_Vector3MathFunctions::Dot'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(86) : error C2061: syntax error : identifier 'Vector3'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(87) : error C2061: syntax error : identifier 'Vector3'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(87) : error C2556: 'Vector4 *Vector4::FromVector3(void)' : overloaded function differs only by return type from 'Vector4 Vector4::FromVector3(void)'
1> c:\westwood\renegadefds\server\new folder\engine_math.h(86) : see declaration of 'Vector4::FromVector3'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(87) : error C2040: 'Vector4::FromVector3' : 'Vector4 *(void)' differs in levels of indirection from 'Vector4 (void)'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(222) : error C2146: syntax error : missing ';' before identifier 'Center'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(222) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\westwood\renegadefds\server\new folder\engine_math.h(222) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\westwood\renegadefds\server\new folder\engine_math.h(223) : error C2146: syntax error : missing ';' before identifier 'Extent'
1>c:\westwood\renegadefds\server\new folder\engine_math.h(223) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\westwood\renegadefds\server\new folder\engine_math.h(223) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\westwood\renegadefds\server\new folder\engine_net.h(67) : error C2061: syntax error : identifier 'Vector3'
1>c:\westwood\renegadefds\server\new folder\engine_def.h(104) : error C2065: 'GameObject' : undeclared identifier
1>c:\westwood\renegadefds\server\new folder\engine_def.h(104) : error C2065: 'obj' : undeclared identifier
1>c:\westwood\renegadefds\server\new folder\engine_def.h(104) : fatal error C1903: unable to recover from previous error(s); stopping compilation
1>gmmain.cpp
1>Generating Code...
1>Creating browse information file...
1>Microsoft Browse Information Maintenance Utility Version 8.00.50727
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>BSCMAKE: error BK1506 : cannot open file '.\tmp\scripts\debug\MySwapCharScript.sbr': No such file or directory
1>Build log was saved at "file://c:\Westwood\RenegadeFDS\Server\New Folder\tmp\scripts\debug\BuildLog.htm"
1>SSGM - 83 error(s), 8 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
[Updated on: Wed, 11 August 2010 17:00] Report message to a moderator
|
|
|
|
Re: START_TIMER Parameters [message #434649 is a reply to message #434519] |
Thu, 12 August 2010 11:50 |
|
T0tNl
Messages: 63 Registered: July 2007
Karma: 0
|
Recruit |
|
|
I have fixed the code( I think(it compiles without errors)) but does not work. Do you see anything wronge? I just change to the "CnC_Nod_FlameThrower_2SF" preset and thats it.
MySwapCharScript.cpp
#include "scripts.h"
#include "engine.h"
#include "MySwapCharScript.h"
void MySwapCharScript::Created(GameObject *obj)
{
float maxH = Commands->Get_Max_Health(obj);
float curH = Commands->Get_Health(obj);
float maxS = Commands->Get_Max_Shield_Strength(obj);
float curS = Commands->Get_Shield_Strength(obj);
Change_Character(obj, "clown"); //Change preset
Commands->Set_Health(obj,curH); //Set health to that of the previous preset
Commands->Set_Shield_Strength(obj,curS); //Set shield to that of the previous preset
Set_Max_Health(obj, maxH); //Set max health to that of the previous preset
Set_Max_Shield_Strength(obj, maxS); //Set max shield to that of the previous preset
}
MySwapCharScript.h
class MySwapCharScript : public ScriptImpClass
{
void Created(GameObject *obj);
};
gmmain.cpp
class testChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
float Credits = Commands->Get_Money(obj);
int Team = Get_Object_Type(obj);
Vector3 position;
position = Commands->Get_Position(obj);
{
if(Credits >= 10 && (Team == 0) ){
Commands->Give_Money(obj,-10,false);
char message[256];
Change_Character(obj, "CnC_Nod_FlameThrower_2SF");
Commands->Attach_Script(obj, "MySwapCharScript" , "");
sprintf(message,"msg %s has bought a test character.", Get_Player_Name_By_ID(ID));
Console_Input(message);
Commands->Set_Position(obj,position);
}
else{
Console_Input(StrFormat("ppage %d You need 10 credits for this selection!.",Get_Player_ID(obj)).c_str());
}
}
}
};
ChatCommandRegistrant<testChatCommand> testChatCommandReg("!test",CHATTYPE_ALL,0,GAMEMODE_AOW);
[Updated on: Thu, 12 August 2010 12:43] Report message to a moderator
|
|
|
|
Re: START_TIMER Parameters [message #434668 is a reply to message #434657] |
Thu, 12 August 2010 15:07 |
|
T0tNl
Messages: 63 Registered: July 2007
Karma: 0
|
Recruit |
|
|
reborn wrote on Thu, 12 August 2010 15:29 | You forgot the script registrant.
|
Like this?>::
scriptregistrant<MySwapCharScript> MySwapCharScript_Registrant("MySwapCharScript","");
Also do I add this in gmmain.cpp or MySwapCharScript.cpp(for my case).I don't know as I've never done this before.
I also get an error during build if I put it in either/or gmmain or the other .cpp::
1>------ Build started: Project: SSGM, Configuration: Debug Win32 ------
1>Compiling...
1>MySwapCharScript.cpp
1>.\MySwapCharScript.cpp(20) : error C2143: syntax error : missing ';' before '<'
1>.\MySwapCharScript.cpp(20) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>Creating browse information file...
1>Microsoft Browse Information Maintenance Utility Version 8.00.50727
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Build log was saved at "file://c:\Westwood\RenegadeFDS\Server\New Folder\tmp\scripts\debug\BuildLog.htm"
1>SSGM - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
[Updated on: Thu, 12 August 2010 15:08] Report message to a moderator
|
|
|
|
Re: START_TIMER Parameters [message #434679 is a reply to message #434676] |
Thu, 12 August 2010 17:52 |
|
T0tNl
Messages: 63 Registered: July 2007
Karma: 0
|
Recruit |
|
|
Thank's Omar && Reborn, I tested it a few time's it does NOT work. It just changes me to the preset sbh, I just capitalized what Omar had said. If I change Chance_Character(obj, "clown") to Commands->Set_Model(obj, "clown") what it does is the first time you type the command it change's to the sbh only, the second time it changes you to the clown model, however it's in animation freeze.
|
|
|
Goto Forum:
Current Time: Wed Dec 18 00:09:48 MST 2024
Total time taken to generate the page: 0.01104 seconds
|