Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Making a buildup with Timers and Set_Position?
icon5.gif  Making a buildup with Timers and Set_Position? [message #378399] Thu, 02 April 2009 00:37 Go to next message
whtdrgnpl is currently offline  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 #378407 is a reply to message #378399] Thu, 02 April 2009 04:06 Go to previous messageGo to next message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
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.

http://steamsignature.com/card/1/76561197975867233.png

[Updated on: Thu, 02 April 2009 04:07]

Report message to a moderator

Re: Making a buildup with Timers and Set_Position? [message #378413 is a reply to message #378407] Thu, 02 April 2009 05:29 Go to previous messageGo to next message
nopol10 is currently offline  nopol10
Messages: 1043
Registered: February 2005
Location: Singapore
Karma: 0
General (1 Star)
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.

nopol10=Nopol=nopol(GSA)

http://i14.photobucket.com/albums/a330/napalmic/siggy.jpg
Re: Making a buildup with Timers and Set_Position? [message #378439 is a reply to message #378399] Thu, 02 April 2009 11:31 Go to previous messageGo to next message
mrãçķz is currently offline  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 Go to previous messageGo to next message
whtdrgnpl is currently offline  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 Huh 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 Go to previous messageGo to next message
mrãçķz is currently offline  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 Sad

[Updated on: Thu, 02 April 2009 14:27]

Report message to a moderator

Re: Making a buildup with Timers and Set_Position? [message #378543 is a reply to message #378399] Thu, 02 April 2009 23:58 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
Are you registering the script with ScriptRegistrant?
Re: Making a buildup with Timers and Set_Position? [message #378690 is a reply to message #378399] Fri, 03 April 2009 23:06 Go to previous messageGo to next message
whtdrgnpl is currently offline  whtdrgnpl
Messages: 17
Registered: July 2007
Karma: 0
Recruit
Ya I am and thanks mad I got it working I just had to add another timer to kill the invis object after 10 secs lol
Re: Making a buildup with Timers and Set_Position? [message #378699 is a reply to message #378399] Sat, 04 April 2009 02:09 Go to previous message
mrãçķz is currently offline  mrãçķz
Messages: 3069
Registered: August 2007
Karma: 0
General (3 Stars)
Permabanned for trying and failing DDoS
If you cant get something to work, just think aboiut faking something!
Previous Topic: Scrin's Ultimates Collection (update)
Next Topic: extending?
Goto Forum:
  


Current Time: Thu Jan 23 13:52:35 MST 2025

Total time taken to generate the page: 0.00932 seconds