Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Stealth command help
Re: Stealth command help [message #408570 is a reply to message #408565] Tue, 27 October 2009 13:30 Go to previous messageGo to previous message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma:
General (3 Stars)
Hubba wrote on Tue, 27 October 2009 15:10

reborn wrote on Tue, 27 October 2009 13:29

It absolutely will attach to an invis object. Did you remember the scripts registrant?

//edit

I see what you're doing wrong.. It's "Invisible_Object", not "Invis_Object".



That did the trick.

Okey i got it work. But i want you to take a look:

Join_hook
if(Get_GameObj(i)){
Attach_Script_Once(Get_GameObj(i),"Test_hubba","");
}
else {
Vector3 pos;
pos.X = 0.0f;
pos.Y = 0.0f;
pos.Z = 0.0f;
GameObject *invis = Commands->Create_Object("Invisible_Object", pos);
Attach_Script_Once(invis,"Test_hubba1","");



Test_hubba1
void Test_hubba1::Created(GameObject *obj){
Commands->Start_Timer(obj,this,1.0f,1);
}

void Test_hubba1::Timer_Expired(GameObject *obj,int ID)
{
if(Get_GameObj(ID)){
	for (int a = 0; a < 128; a++){
	if(IsPlayerStealth[a] == true){
	Commands->Enable_Stealth(Get_GameObj(a),true);
    }
}

}
else {
Attach_Script_Once(obj,"Test_hubba1","");
   }	
}


Test_hubba
void Test_hubba::Created(GameObject *obj){
	 Commands->Start_Timer(obj,this,5.0f,1);
}

void Test_hubba::Timer_Expired(GameObject *obj,int number)
{
 	if (number == 1){
for (int a = 0; a < 128; a++){
	if(IsPlayerStealth[a] == true){
	Commands->Enable_Stealth(Get_GameObj(a),true);
           }
      }
}
}




Now it depends on how fast you load. If i put in hubba_test1 the timer to for example 0.5 then it would be way to fast. But 1.0 works for me. But if we got a really slow player then it wouldnt work? Well i could put the timer to like 5.0 like i have in hubba_test then i would get most of the players.

Yes i dont really know if i coded anything right in hubba_test1 so if you could take a look it would be nice.


hubba_test1 is not correct, infact it's wrong on several levels...
I am watching a movie and do not have time to correct it for you right now. However, the following is something that when I was first looking at the API and trying to figure shit out, I would of appreciated someone showing me...


void Test_hubba1::Created(GameObject *obj){
Commands->Start_Timer(obj,this,1.0f,1); //number 1 at the end is kinda like a unique timer event...
}

void Test_hubba1::Timer_Expired(GameObject *obj,int number){
if(number == 1){ // this here is your number 1 from the previous comment
// do some crap here, check if the dude has a GameObject yet...
Commands->Start_Timer(obj,this,1.0f,1); // omg, it will loop again every second forever...
}
}



void Test_hubba1::Created(GameObject *obj){
Commands->Start_Timer(obj,this,1.0f,1);
Commands->Start_Timer(obj,this,10.0f,2);
Commands->Start_Timer(obj,this,50.0f,3);
}

void Test_hubba1::Timer_Expired(GameObject *obj,int number){
if(number == 1){// this is triggered after a seconds...

}
else if(number == 2){// this is triggered after 10 seconds...

}
else if(number == 3){// this is triggered after 50 seconds...

}
}



void Test_hubba1::Created(GameObject *obj){
Commands->Start_Timer(obj,this,1.0f,1); //number 1 at the end is kinda like a unique timer event...
}

void Test_hubba1::Timer_Expired(GameObject *obj,int number){
if(number == 1){ 
if(1 == 1){ // Just an example conditional.. you could for example check to see if the player is a gameobject here!!! :0
printf("1 equals 1");
Commands->Start_Timer(obj,this,1.0f,1);
}
else{// one does not equal 1, this is a break in the timer loop... The conditional does not pass, and there is no timer start in this statment

}
}
}





 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: I need of a modified scripts.dll
Next Topic: Level Edit Problem
Goto Forum:
  


Current Time: Sat Dec 21 08:42:11 MST 2024

Total time taken to generate the page: 0.01443 seconds