Jump to content
paulo ve

Fp_freeplay

Recommended Posts

Help

Error line 25!!!

Barterode-Modifikation

 

 

// Freeplay-Start (Grundgeruest + Einstellungs-Codeblock fuer Fahrzeuge)
 
void Start()
{
GameObjectList l1;
GameObject *o1;
 
//// <BLOCK> ////////////////////////////////////////////////////////////////////////////////////////////
 
               l1 = Game::GameObject("water_supply_main");
 
               if(l1.GetNumObjects() > 0)
{
GameObject Obj = l1.GetObject(0);
Game::ExecuteCommand("DummyCheckWaterSupply", &Obj);
System::Log("WATER, Start DummyCheckWaterSupply");
} else
System::Log("WATER, Can not find object with name: water_supply_main");  
               }
 
 
//// <BLOCK> ////////////////////////////////////////////////////////////////////////////////////////////
 
l1 = Game::GetGameObjects("MTW"); // FAHRZEUGNAME muss einmalig sein auf der Map
 
if(l1.GetNumObjects() == 0)
{
Mission::PlayHint("Fahrzeug befindet sich nicht auf der Karte!"); // *
}
else
{
o1 = *l1.GetObject(0);
Vehicle v(o1);
 
v.SetSpeed(16.0f); // Wert anpassen ...
v.SetMaxPassengers(2); // Wert anpassen ...
v.SetMaxTransports(0); // Wert anpassen ...
v.AssignCommand("ParkAtBase"); // Park-Kommando zuweisen
v.EnableBlueLights(false);
}
 
 
 
//// <BLOCK> ////////////////////////////////////////////////////////////////////////////////////////////
 
l1 = Game::GetGameObjects("TLF"); // FAHRZEUGNAME muss einmalig sein auf der Map
 
if(l1.GetNumObjects() == 0)
{
Mission::PlayHint("Fahrzeug befindet sich nicht auf der Karte!"); // *
}
else
{
o1 = *l1.GetObject(0);
Vehicle v(o1);
 
v.SetSpeed(13.0f); // Wert anpassen ...
v.SetMaxPassengers(9); // Wert anpassen ...
v.SetMaxTransports(0); // Wert anpassen ...
v.AssignCommand("ParkAtBase"); // Park-Kommando zuweisen
v.EnableBlueLights(false);
}
 
 
 
//// <BLOCK> ////////////////////////////////////////////////////////////////////////////////////////////
 
l1 = Game::GetGameObjects("TSF"); // FAHRZEUGNAME muss einmalig sein auf der Map
 
if(l1.GetNumObjects() == 0)
{
Mission::PlayHint("Fahrzeug befindet sich nicht auf der Karte!"); // *
}
else
{
o1 = *l1.GetObject(0);
Vehicle v(o1);
 
v.SetSpeed(13.0f); // Wert anpassen ...
v.SetMaxPassengers(9); // Wert anpassen ...
v.SetMaxTransports(0); // Wert anpassen ...
v.AssignCommand("ParkAtBase"); // Park-Kommando zuweisen
v.EnableBlueLights(false);
}
 
 
 
//// <BLOCK> ////////////////////////////////////////////////////////////////////////////////////////////
 
l1 = Game::GetGameObjects("STW1"); // FAHRZEUGNAME muss einmalig sein auf der Map
 
if(l1.GetNumObjects() == 0)
{
Mission::PlayHint("Fahrzeug befindet sich nicht auf der Karte!"); // *
}
else
{
o1 = *l1.GetObject(0);
Vehicle v(o1);
 
v.SetSpeed(13.0f); // Wert anpassen ...
v.SetMaxPassengers(9); // Wert anpassen ...
v.SetMaxTransports(0); // Wert anpassen ...
v.AssignCommand("ParkAtBase"); // Park-Kommando zuweisen
v.EnableBlueLights(false);
}
 
 
 
//// <BLOCK> ////////////////////////////////////////////////////////////////////////////////////////////
 
l1 = Game::GetGameObjects("STW2"); // FAHRZEUGNAME muss einmalig sein auf der Map
 
if(l1.GetNumObjects() == 0)
{
Mission::PlayHint("Fahrzeug befindet sich nicht auf der Karte!"); // *
}
else
{
o1 = *l1.GetObject(0);
Vehicle v(o1);
 
v.SetSpeed(13.0f); // Wert anpassen ...
v.SetMaxPassengers(9); // Wert anpassen ...
v.SetMaxTransports(0); // Wert anpassen ...
v.AssignCommand("ParkAtBase"); // Park-Kommando zuweisen
v.EnableBlueLights(false);
}
 
 
 
//// <BLOCK> ////////////////////////////////////////////////////////////////////////////////////////////
 
l1 = Game::GetGameObjects("STW3"); // FAHRZEUGNAME muss einmalig sein auf der Map
 
if(l1.GetNumObjects() == 0)
{
Mission::PlayHint("Fahrzeug befindet sich nicht auf der Karte!"); // *
}
else
{
o1 = *l1.GetObject(0);
Vehicle v(o1);
 
v.SetSpeed(13.0f); // Wert anpassen ...
v.SetMaxPassengers(9); // Wert anpassen ...
v.SetMaxTransports(0); // Wert anpassen ...
v.AssignCommand("ParkAtBase"); // Park-Kommando zuweisen
v.EnableBlueLights(false);
}
 
 
 
//// </BLOCK> ///////////////////////////////////////////////////////////////////////////////////////////
};
 
bool OnLoad()
{
Start();
Process::Kill();
return true;
}
Link to comment
Share on other sites

what is the error you get?

'cause for what I can see ( i don't have much experience) it looks like you forgot to add a unit with a specific name, and now it can't find the unit to let the script work

 

 //// <BLOCK> //////////////////////////////////////////////////////////////////////////////////////////// l1 = Game::GetGameObjects("MTW"); // FAHRZEUGNAME muss einmalig sein auf der Map <--- is this the vehicle you want to attach the water supply? 'Cause now it's the police van if(l1.GetNumObjects() == 0){Mission::PlayHint("Fahrzeug befindet sich nicht auf der Karte!"); // *}else{o1 = *l1.GetObject(0);Vehicle v(o1); v.SetSpeed(16.0f); // Wert anpassen ...v.SetMaxPassengers(2); // Wert anpassen ...v.SetMaxTransports(0); // Wert anpassen ...v.AssignCommand("ParkAtBase"); // Park-Kommando zuweisenv.EnableBlueLights(false);}
Link to comment
Share on other sites

 

what is the error you get?

'cause for what I can see ( i don't have much experience) it looks like you forgot to add a unit with a specific name, and now it can't find the unit to let the script work

 //// <BLOCK> //////////////////////////////////////////////////////////////////////////////////////////// l1 = Game::GetGameObjects("MTW"); // FAHRZEUGNAME muss einmalig sein auf der Map <--- is this the vehicle you want to attach the water supply? 'Cause now it's the police van if(l1.GetNumObjects() == 0){Mission::PlayHint("Fahrzeug befindet sich nicht auf der Karte!"); // *}else{o1 = *l1.GetObject(0);Vehicle v(o1); v.SetSpeed(16.0f); // Wert anpassen ...v.SetMaxPassengers(2); // Wert anpassen ...v.SetMaxTransports(0); // Wert anpassen ...v.AssignCommand("ParkAtBase"); // Park-Kommando zuweisenv.EnableBlueLights(false);}

managed to put in order the script, but I can not fix the final part for the vehicles have water supply!!!

 

// Freeplay-Start (Grundgeruest + Einstellungs-Codeblock fuer Fahrzeuge)
 
void Start()
{
GameObjectList l1;
GameObject *o1;
 
//// <BLOCK> ////////////////////////////////////////////////////////////////////////////////////////////
 
l1 = Game::GetGameObjects("MTW");  // FAHRZEUGNAME muss einmalig sein auf der Map
 
if(l1.GetNumObjects() == 0)
{
Mission::PlayHint("Fahrzeug befindet sich nicht auf der Karte!"); // *
}
else
{
o1 = *l1.GetObject(0);
Vehicle v(o1);
 
v.SetSpeed(16.0f); // Wert anpassen ...
v.SetMaxPassengers(2); // Wert anpassen ...
v.SetMaxTransports(0); // Wert anpassen ...
v.AssignCommand("ParkAtBase"); // Park-Kommando zuweisen
v.EnableBlueLights(false);
}
 
 
 
//// <BLOCK> ////////////////////////////////////////////////////////////////////////////////////////////
 
l1 = Game::GetGameObjects("TLF");  // FAHRZEUGNAME muss einmalig sein auf der Map
 
if(l1.GetNumObjects() == 0)
{
Mission::PlayHint("Fahrzeug befindet sich nicht auf der Karte!"); // *
}
else
{
o1 = *l1.GetObject(0);
Vehicle v(o1);
 
v.SetSpeed(13.0f); // Wert anpassen ...
v.SetMaxPassengers(9); // Wert anpassen ...
v.SetMaxTransports(0); // Wert anpassen ...
v.AssignCommand("ParkAtBase"); // Park-Kommando zuweisen
v.EnableBlueLights(false);
}
 
 
 
//// <BLOCK> ////////////////////////////////////////////////////////////////////////////////////////////
 
l1 = Game::GetGameObjects("TSF"); // FAHRZEUGNAME muss einmalig sein auf der Map
 
if(l1.GetNumObjects() == 0)
{
Mission::PlayHint("Fahrzeug befindet sich nicht auf der Karte!"); // *
}
else
{
o1 = *l1.GetObject(0);
Vehicle v(o1);
 
v.SetSpeed(13.0f); // Wert anpassen ...
v.SetMaxPassengers(9); // Wert anpassen ...
v.SetMaxTransports(0); // Wert anpassen ...
v.AssignCommand("ParkAtBase"); // Park-Kommando zuweisen
v.EnableBlueLights(false);
}
 
 
 
//// <BLOCK> ////////////////////////////////////////////////////////////////////////////////////////////
 
l1 = Game::GetGameObjects("STW1"); // FAHRZEUGNAME muss einmalig sein auf der Map
 
if(l1.GetNumObjects() == 0)
{
Mission::PlayHint("Fahrzeug befindet sich nicht auf der Karte!"); // *
}
else
{
o1 = *l1.GetObject(0);
Vehicle v(o1);
 
v.SetSpeed(13.0f); // Wert anpassen ...
v.SetMaxPassengers(9); // Wert anpassen ...
v.SetMaxTransports(0); // Wert anpassen ...
v.AssignCommand("ParkAtBase"); // Park-Kommando zuweisen
v.EnableBlueLights(false);
}
 
 
 
//// <BLOCK> ////////////////////////////////////////////////////////////////////////////////////////////
 
l1 = Game::GetGameObjects("STW2"); // FAHRZEUGNAME muss einmalig sein auf der Map
 
if(l1.GetNumObjects() == 0)
{
Mission::PlayHint("Fahrzeug befindet sich nicht auf der Karte!"); // *
}
else
{
o1 = *l1.GetObject(0);
Vehicle v(o1);
 
v.SetSpeed(13.0f); // Wert anpassen ...
v.SetMaxPassengers(9); // Wert anpassen ...
v.SetMaxTransports(0); // Wert anpassen ...
v.AssignCommand("ParkAtBase"); // Park-Kommando zuweisen
v.EnableBlueLights(false);
}
 
 
 
//// <BLOCK> ////////////////////////////////////////////////////////////////////////////////////////////
 
l1 = Game::GetGameObjects("STW3"); // FAHRZEUGNAME muss einmalig sein auf der Map
 
if(l1.GetNumObjects() == 0)
{
Mission::PlayHint("Fahrzeug befindet sich nicht auf der Karte!"); // *
}
else
{
o1 = *l1.GetObject(0);
Vehicle v(o1);
 
v.SetSpeed(13.0f); // Wert anpassen ...
v.SetMaxPassengers(9); // Wert anpassen ...
v.SetMaxTransports(0); // Wert anpassen ...
v.AssignCommand("ParkAtBase"); // Park-Kommando zuweisen
v.EnableBlueLights(false);
}
 
 
 
//// </BLOCK> ///////////////////////////////////////////////////////////////////////////////////////////
 
               l1 = Game::GameObject("water_supply_main");  // FAHRZEUGNAME muss einmalig sein auf der Map
              
               if(l1.GetNumObjects() == 0)
{
o1 = *l1.GetObject(0);
Mission::ExecuteCommand("DummyCheckWaterSupply", &Obj);
System::Log("WATER, Start DummyCheckWaterSupply");
               }
               else
               {
System::Log("WATER, Can not find object with name: water_supply_main");   
               }
 
 
 
//// <BLOCK> ////////////////////////////////////////////////////////////////////////////////////////////
};
 
bool OnLoad()
{
Start();
              System::SetEnv("e4_doocclusion", 0);
Process::Kill();
return true;
}
Link to comment
Share on other sites

 

You have to change:

l1 = Game::GameObject("water_supply_main");  // FAHRZEUGNAME muss einmalig sein auf der Map

to this:

l1 = Game::GetGameObjects("water_supply_main");  // FAHRZEUGNAME muss einmalig sein auf der Map

I've tried, but it gave error that the object has to be caught!!

Link to comment
Share on other sites

Any objet with the name water_supply_main? It has to be min and max 1 time on the map.

 

And by the way, anyway you unblock your ! key? It's quite anoying for us to see that after every comment

yes I agree, but I can not play the water supply to the map and not the script! can not unlock!

Link to comment
Share on other sites

I think I did all mundanças but it did not work!

 

Can you reupload the entire script?

 

Also, looking at the error, it seems like you wrote GameObjects instead of GetGameObjects.

But without the changed script and a logfile it's hard to tell.

Link to comment
Share on other sites

Can you reupload the entire script?

 

Also, looking at the error, it seems like you wrote GameObjects instead of GetGameObjects.

But without the changed script and a logfile it's hard to tell.

you want the original file??

 

edited but does not appear to support the water!!

 

//// </BLOCK> ///////////////////////////////////////////////////////////////////////////////////////////
 
              l1 = Game::GetGameObjects("water_supply_main");
if(l1.GetNumObjects() == 0)
{
Obj = *l1.GetObject(0);
Game::ExecuteCommand("DummyCheckWaterSupply", &Obj);
System::Log("WATER, Start DummyCheckWaterSupply");
               }
               else
               {
System::Log("WATER, Can not find object with name: water_supply_main");   
               }
 
 
 
//// <BLOCK> ////////////////////////////////////////////////////////////////////////////////////////////
};
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...