Zum Inhalt wechseln


Foto

Fp_freeplay

script

  • Please log in to reply
14 replies to this topic

#1 paulo ve

paulo ve

    Captain

  • Members
  • 205 Beiträge:

Geschrieben 03 November 2013 - 03:56

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;
}


#2 cops

cops

    Assistant Chief

  • Members
  • 1.666 Beiträge:
  • Gender:Male

Geschrieben 03 November 2013 - 08:33

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 zuweisen
v.EnableBlueLights(false);
}

QHVZAKw.png

 

**NOTE**

I don't take any requests any more,except for ;

Red Watch (RCMP)


#3 paulo ve

paulo ve

    Captain

  • Members
  • 205 Beiträge:

Geschrieben 03 November 2013 - 08:41

 

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 zuweisen
v.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;
}


#4 paulo ve

paulo ve

    Captain

  • Members
  • 205 Beiträge:

Geschrieben 03 November 2013 - 08:45

Error

Angehängte Datei(en)



#5 Waegi

Waegi

    Firefighter

  • Members
  • 3 Beiträge:

Geschrieben 03 November 2013 - 09:01

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


#6 paulo ve

paulo ve

    Captain

  • Members
  • 205 Beiträge:

Geschrieben 03 November 2013 - 09:29

 

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!!



#7 Stan

Stan

    Webmaster

  • Webmaster
  • 6.911 Beiträge:
  • Gender:Male
  • Location:Vaals - Nederland

Geschrieben 03 November 2013 - 10:18

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


Webmaster & Technical Support

#8 paulo ve

paulo ve

    Captain

  • Members
  • 205 Beiträge:

Geschrieben 03 November 2013 - 10:47

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!



#9 Hoppah

Hoppah

    Boss cat

  • Administrators
  • 3.879 Beiträge:
  • Gender:Male
  • Location:Special Needs Department

Geschrieben 04 November 2013 - 02:07

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

 

Got the same error?



#10 paulo ve

paulo ve

    Captain

  • Members
  • 205 Beiträge:

Geschrieben 04 November 2013 - 01:15

Got the same error?

not have the same error, changes for this!!

Angehängte Datei(en)



#11 Hoppah

Hoppah

    Boss cat

  • Administrators
  • 3.879 Beiträge:
  • Gender:Male
  • Location:Special Needs Department

Geschrieben 04 November 2013 - 02:02

It's because you didn't make the appropiate changes. Please reupload the script.



#12 paulo ve

paulo ve

    Captain

  • Members
  • 205 Beiträge:

Geschrieben 04 November 2013 - 02:04

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!

Angehängte Datei(en)



#13 Hoppah

Hoppah

    Boss cat

  • Administrators
  • 3.879 Beiträge:
  • Gender:Male
  • Location:Special Needs Department

Geschrieben 04 November 2013 - 02:17

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.



#14 paulo ve

paulo ve

    Captain

  • Members
  • 205 Beiträge:

Geschrieben 04 November 2013 - 02:22

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> ////////////////////////////////////////////////////////////////////////////////////////////
};


#15 paulo ve

paulo ve

    Captain

  • Members
  • 205 Beiträge:

Geschrieben 05 November 2013 - 07:40

Game starts, but it appears the main water supply to the beginning of the game! Help







Also tagged with one or more of these keywords: script