paulo ve Posted November 3, 2013 Report Share Posted November 3, 2013 HelpError 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");} elseSystem::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 zuweisenv.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 zuweisenv.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 zuweisenv.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 zuweisenv.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 zuweisenv.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 zuweisenv.EnableBlueLights(false);} //// </BLOCK> ///////////////////////////////////////////////////////////////////////////////////////////}; bool OnLoad(){Start();Process::Kill();return true;} Link to comment Share on other sites More sharing options...
cops Posted November 3, 2013 Report Share Posted November 3, 2013 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 More sharing options...
paulo ve Posted November 3, 2013 Author Report Share Posted November 3, 2013 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 zuweisenv.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 zuweisenv.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 zuweisenv.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 zuweisenv.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 zuweisenv.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 zuweisenv.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 More sharing options...
paulo ve Posted November 3, 2013 Author Report Share Posted November 3, 2013 Error Link to comment Share on other sites More sharing options...
Waegi Posted November 3, 2013 Report Share Posted November 3, 2013 You have to change:l1 = Game::GameObject("water_supply_main"); // FAHRZEUGNAME muss einmalig sein auf der Mapto this:l1 = Game::GetGameObjects("water_supply_main"); // FAHRZEUGNAME muss einmalig sein auf der Map Link to comment Share on other sites More sharing options...
paulo ve Posted November 3, 2013 Author Report Share Posted November 3, 2013 You have to change:l1 = Game::GameObject("water_supply_main"); // FAHRZEUGNAME muss einmalig sein auf der Mapto this:l1 = Game::GetGameObjects("water_supply_main"); // FAHRZEUGNAME muss einmalig sein auf der MapI've tried, but it gave error that the object has to be caught!! Link to comment Share on other sites More sharing options...
Stan Posted November 3, 2013 Report Share Posted November 3, 2013 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 Link to comment Share on other sites More sharing options...
paulo ve Posted November 3, 2013 Author Report Share Posted November 3, 2013 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 commentyes 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 More sharing options...
Hoppah Posted November 4, 2013 Report Share Posted November 4, 2013 I've tried, but it gave error that the object has to be caught!! Got the same error? Link to comment Share on other sites More sharing options...
paulo ve Posted November 4, 2013 Author Report Share Posted November 4, 2013 Got the same error?not have the same error, changes for this!! Link to comment Share on other sites More sharing options...
Hoppah Posted November 4, 2013 Report Share Posted November 4, 2013 It's because you didn't make the appropiate changes. Please reupload the script. Link to comment Share on other sites More sharing options...
paulo ve Posted November 4, 2013 Author Report Share Posted November 4, 2013 It's because you didn't make the appropiate changes. Please reupload the script.I think I did all mundanças but it did not work! Link to comment Share on other sites More sharing options...
Hoppah Posted November 4, 2013 Report Share Posted November 4, 2013 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 More sharing options...
paulo ve Posted November 4, 2013 Author Report Share Posted November 4, 2013 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 More sharing options...
paulo ve Posted November 5, 2013 Author Report Share Posted November 5, 2013 Game starts, but it appears the main water supply to the beginning of the game! Help Link to comment Share on other sites More sharing options...