Re: AirStrike function [message #330017 is a reply to message #301136] |
Sun, 11 May 2008 03:11   |
 |
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
I think the looping is a boolean value at the end of the animation function. Set them all to a 0 and I think it should work...
|
|
|
|
Re: AirStrike function [message #330192 is a reply to message #301136] |
Mon, 12 May 2008 02:45   |
 |
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
They just stay there, but no loop?
That makes sense I guess, it's just stuck on the last frame of the animation...
They are all real objects, so you can destroy them. I can't remember from memory what the right syntax is, but it is most likely something simple like destroy_object;
Or you could attach a script to it that destroys the object after x amount of time...
void reb_timed_destroy::Created(GameObject *obj){
Commands->Start_Timer(obj,this,31.0f,1);
}
void reb_timed_destroy::Timer_Expired(GameObject *obj, int number){
if(number ==1){
Commands->Destroy_Object(obj);
}
}
ScriptRegistrant<reb_timed_destroy> reb_timed_destroy_Registrant("reb_timed_destroy","");
class reb_timed_destroy : public ScriptImpClass {
void Created(GameObject *obj);
void Timer_Expired(GameObject *obj,int number);
};
Just change the float value 31.0f to however many seconds you want it to wait until it destroys the object it is attached to.
|
|
|
Re: AirStrike function [message #330229 is a reply to message #301136] |
Mon, 12 May 2008 11:52   |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
why cant i get it i think i put the codes in the right places.....unless someone cant tell me? but this is what i get
1>.\gmscripts.cpp(68) : error C3861: 'Get_Random_Building': identifier not found
1>.\gmscripts.cpp(128) : error C3861: 'Get_Random_Building': identifier not found
1>.\gmscripts.cpp(1506) : error C2448: 'GDIreChatCommandReg' : function-style initializer appears to be a function definition
but like i said i not sure what file to put them in but ya
im also confussed on this and all the other codes everyone release here...wat files to put the code in
[Updated on: Mon, 12 May 2008 12:27] Report message to a moderator
|
|
|
Re: AirStrike function [message #330321 is a reply to message #330229] |
Tue, 13 May 2008 04:04  |
EA-DamageEverything
Messages: 423 Registered: January 2005 Location: Germany
Karma: 0
|
Commander |
|
|
SSnipe wrote on Mon, 12 May 2008 20:52 | why cant i get it i think i put the codes in the right places
1>.\gmscripts.cpp(68) : error C3861: 'Get_Random_Building': identifier not found
...wat files to put the code in
| The Random_Building is an addition to SSGM and has to be put in this way:
engine_gm.cpp
GameObject * Get_Random_Building(int Team) {
std::vector<GameObject*> Buildings;
GenericSLNode *x = BuildingGameObjList->HeadNode;
while (x != 0) {
GameObject *obj = (GameObject *)x->NodeData;
if (obj && (Get_Object_Type(obj) == Team || Team == 2) && !Is_Building_Dead(obj)) {
Buildings.push_back(obj);
}
x = x->NodeNext;
}
if (!Buildings.empty()) {
int Rand = Commands->Get_Random_Int(0,Buildings.size());
return Buildings[Rand];
}
return 0;
}
This comes right after "GameObject *Find_My_Veh"
---------
To get it working, you have to put the following into
engine_gm.h
GameObject *Get_Random_Building(int Team); // Selects a random building which has to be alive
This goes under "GameObject *Find_My_Veh(GameObject *obj); //Find my vehicle"
----------------
Generally, scripts should go into the gmmain.cpp, their classes into gmmain.h, ScriptRegistrants into gmmain.cpp OR gmcrate.cpp (does work even if it isn't a crate event). Chat hooks are in the gmmain.cpp, their Scriptregistrants can be put either in gmmain.cpp OR gmcrate.cpp.
==========
Reborn thanks for the script, I'll check it later.
|
|
|