Home » Renegade Discussions » Mod Forum » Making a buildup with Timers and Set_Position?
Making a buildup with Timers and Set_Position? [message #378399] |
Thu, 02 April 2009 00:37 |
|
whtdrgnpl
Messages: 17 Registered: July 2007
Karma: 0
|
Recruit |
|
|
I'm trying to make a build up thing using timers and Set_Position but whenever I use it, it doesn't move at all... but the timer part works it's just not moving the conyard at all. Does Set_Position only work on players?
void NodCYTimer::Timer_Expired(GameObject *obj, int number) {
Vector3 position;
position = Commands->Get_Position(obj);
if (number == 1){
position.Z += 1.0f;
Commands->Set_Position(obj,position);
}
if (number == 2){
position.Z += 1.0f;
Commands->Set_Position(obj,position);
}
if (number == 3){
position.Z += 1.0f;
Commands->Set_Position(obj,position);
}
if (number == 4){
position.Z += 1.0f;
Commands->Set_Position(obj,position);
}
if (number == 5){
position.Z += 1.0f;
Commands->Set_Position(obj,position);
}
if (number == 6){
position.Z += 1.0f;
Commands->Set_Position(obj,position);
}
if (number == 7){
position.Z += 1.0f;
Commands->Set_Position(obj,position);
}
if (number == 8){
position.Z += 1.0f;
Commands->Set_Position(obj,position);
}
if (number == 9){
position.Z += 1.0f;
Commands->Set_Position(obj,position);
}
if (number == 10){
position.Z += 1.0f;
Commands->Set_Position(obj,position);
}
if (number == 11){
position.Z += 1.0f;
Commands->Set_Position(obj,position);
}
if (number == 12){
position.Z += 1.0f;
Commands->Set_Position(obj,position);
Console_Input("snda m00bgwf_dsgn0004i1evag_snd.wav");
}
}
[Updated on: Thu, 02 April 2009 00:38] Report message to a moderator
|
|
|
|
|
Re: Making a buildup with Timers and Set_Position? [message #378439 is a reply to message #378399] |
Thu, 02 April 2009 11:31 |
|
mrãçķz
Messages: 3069 Registered: August 2007
Karma: 0
|
General (3 Stars) Permabanned for trying and failing DDoS |
|
|
I think i did send my BuildUp code to wittebolx a while ago, ask him
or try this
void NodCYTimer::Timer_Expired(GameObject *obj, int number) {
Vector3 position;
position = Commands->Get_Position(obj);
if (number == 1){
position.Z += 1.0f;
Commands->Set_Position(obj,position);
}
if (number == 2){
position.Z += 2.0f;
Commands->Set_Position(obj,position);
}
if (number == 3){
position.Z += 3.0f;
Commands->Set_Position(obj,position);
}
if (number == 4){
position.Z += 4.0f;
Commands->Set_Position(obj,position);
}
if (number == 5){
position.Z += 5.0f;
Commands->Set_Position(obj,position);
}
if (number == 6){
position.Z += 6.0f;
Commands->Set_Position(obj,position);
}
if (number == 7){
position.Z += 7.0f;
Commands->Set_Position(obj,position);
}
if (number == 8){
position.Z += 8.0f;
Commands->Set_Position(obj,position);
}
if (number == 9){
position.Z += 9.0f;
Commands->Set_Position(obj,position);
}
if (number == 10){
position.Z += 10.0f;
Commands->Set_Position(obj,position);
}
if (number == 11){
position.Z += 11.0f;
Commands->Set_Position(obj,position);
}
if (number == 12){
position.Z += 12.0f;
Commands->Set_Position(obj,position);
Console_Input("snda m00bgwf_dsgn0004i1evag_snd.wav");
}
}
[Updated on: Thu, 02 April 2009 11:35] Report message to a moderator
|
|
|
Re: Making a buildup with Timers and Set_Position? [message #378452 is a reply to message #378407] |
Thu, 02 April 2009 12:53 |
|
whtdrgnpl
Messages: 17 Registered: July 2007
Karma: 0
|
Recruit |
|
|
Still doesn't move :/
danpaul88 wrote on Thu, 02 April 2009 05:06 | What are you calling it on? The exterior terrain preset, the building controller or one of the interior tiles? If it's the controller then your only moving the actual controller and not the building itself... as for the exterior terrain, I don't think you CAN move terrain, but I have never tried it.
|
I'm calling it on this:
position = Commands->Get_Position(Get_GameObj(ID));
position.Z -= 12.0f;
Console_Input(StrFormat("sndp %d m00evan_dsgn0002i1evan_snd.wav",ID).c_str());
Set_Money(ID,Commands->Get_Money(Get_GameObj(ID))-3000);
GameObject *ncy = Commands->Create_Object("GDI Gunboat",position);
Commands->Set_Model(ncy, "enc_ncon");
Commands->Set_Player_Type(ncy,0);
Commands->Attach_Script(ncy,"NodCYTimer","");
nopol10 wrote on Thu, 02 April 2009 06:29 | You have to start the timer again at the end of the event or at whichever part is needed for it to run, else it only runs once.
|
I don't really get what you mean but uh these are the timers I have for it.
void NodCYTimer::Created(GameObject *obj) {
Commands->Start_Timer(obj,this,10.0f,1);
Commands->Start_Timer(obj,this,20.0f,2);
Commands->Start_Timer(obj,this,30.0f,3);
Commands->Start_Timer(obj,this,40.0f,4);
Commands->Start_Timer(obj,this,50.0f,5);
Commands->Start_Timer(obj,this,60.0f,6);
Commands->Start_Timer(obj,this,70.0f,7);
Commands->Start_Timer(obj,this,80.0f,8);
Commands->Start_Timer(obj,this,90.0f,9);
Commands->Start_Timer(obj,this,100.0f,10);
Commands->Start_Timer(obj,this,110.0f,11);
Commands->Start_Timer(obj,this,126.0f,12);
}
[Updated on: Thu, 02 April 2009 12:54] Report message to a moderator
|
|
|
Re: Making a buildup with Timers and Set_Position? [message #378462 is a reply to message #378399] |
Thu, 02 April 2009 14:26 |
|
mrãçķz
Messages: 3069 Registered: August 2007
Karma: 0
|
General (3 Stars) Permabanned for trying and failing DDoS |
|
|
Do this thats how i did it SERVERSIDE!
if num 1 = create InvisObject with the model you want then use Destroy_Object()
if num 2 = create InvisObject with the model you want then use Destroy_Object()
if num 3 = create InvisObject with the model you want then use Destroy_Object()
if num 4 = create REAL PRESET without Destroy_Object()
and for every timer use new Position. I can make you a script tomorrow, g2g sleep working tomorrow
[Updated on: Thu, 02 April 2009 14:27] Report message to a moderator
|
|
|
|
|
|
Goto Forum:
Current Time: Thu Jan 23 14:05:38 MST 2025
Total time taken to generate the page: 0.01481 seconds
|