Jump to content
Hoppah

[Released] Limited Water Supply Logic

Recommended Posts

bool OnLoad()

{

start();

System::SetEnv("e4_doocclusion", 0);

Process::Kill();

return true;

}

 

void start()

{

GameObjectList l1("fs1_cp");

if (l1.GetNumObjects() > 0)

{

GameObject Obj = l1.GetObject(0);

Game::ExecuteCommand("VcmdStart", &Obj);

                            System::Log("WATER, Start DummyCheckWaterSupply");

} else

System::Log("WATER, Can not find object with name: water_supply_main");

}

 

GameObjectList l2("random_check");

if (l2.GetNumObjects() > 0)

{

GameObject obj = l2.GetObject(0);

obj.SetUserData(1);

obj.Hide();

Game::ExecuteCommand("RandomSpawn", &obj);

}

};

 

Tem um problema hoppah,erro sintx???

Link to comment
Share on other sites

Along with the pump idea could you make it so one firefighter was required to be still in the vehicle for the pump to operate? Like in the US Army mod where a unused Firefighter was required to operate the water cannon... I know all the department's I have had experience with require 1 firefighter to be running the pump at all times. So if the truck has 6 firefighters 1 sets up the filler line (nearest truck or hydrant), 4 get hoses and attach them. Then on a command (button on menu) the remaining firefighter inside the truck appears outside by the control panel and then the hoses will work.

 

That, and/or seeing the possibility of having top-mount pump units, whereas the guy would be up on top of the rig like he is in the US Army Mod? Yay!

Link to comment
Share on other sites

Yes, the firefighter would have to be wherever he would be in real life. This would require additional scripting/modeling for any truck though as a new model would have to be made. Additional problems would stem from the firefighters being disproportionally large compared to the vehicles.

Link to comment
Share on other sites

We'll I was just indicating if it would be possible, not requesting anything. My team and are pretty capable, and could most likely creat such a vehicle if we wanted to, as long as it was possible with minimal scripting (although we could probably manage otherwise)

Link to comment
Share on other sites

Just some interesting playing around i did until hoppah gives us instruction to add this to other mods ( I tryed didn't go so well so now im waiting! ) 

 

Based off the US general pump rated of 1000 Gallons / Minute I found that with the following settings 

int MAX_WATER_TLF	 		= 1300;int MAX_WATER_LPF	 		= 400;int MAX_WATER_GTF	 		= 1000;int MAX_WATER_DLK	 		= 500;int OUTTAKE_HOSE 			= 30;	//outtake per secondint OUTTAKE_TLF_CANNON 		= 50;int OUTTAKE_LPF_CANNON 		= 50;int OUTTAKE_DLK_CANNON 		= 50;int INTAKE_SUPPLYLINE 		= 80;

You can run 3 hose lines at a time with out depleting your water source( 4 or more will work until the tank is empty ), Or you can run one hose line and the deck cannon. ( 2 ore more hose lines and the deck cannon works until the tank is empty)

 

With this it ads more to the script to limit just how much water you can flow, Hydrants have limits to you know! 

Link to comment
Share on other sites

Tem um problema hoppah,erro sintx???

 

?

 

No hablo español.

 

But it's not hard to guess what you were trying and you're code will not work because it executes the wrong command. Like I said before, I'll post instructions tomorrow. It's fairly easy to implement this into another mod, you just need to know which files you gotta copy.

 

 

Just some interesting playing around i did until hoppah gives us instruction to add this to other mods ( I tryed didn't go so well so now im waiting! ) 

 

Based off the US general pump rated of 1000 Gallons / Minute I found that with the following settings 

int MAX_WATER_TLF	 		= 1300;int MAX_WATER_LPF	 		= 400;int MAX_WATER_GTF	 		= 1000;int MAX_WATER_DLK	 		= 500;int OUTTAKE_HOSE 			= 30;	//outtake per secondint OUTTAKE_TLF_CANNON 		= 50;int OUTTAKE_LPF_CANNON 		= 50;int OUTTAKE_DLK_CANNON 		= 50;int INTAKE_SUPPLYLINE 		= 80;

You can run 3 hose lines at a time with out depleting your water source( 4 or more will work until the tank is empty ), Or you can run one hose line and the deck cannon. ( 2 ore more hose lines and the deck cannon works until the tank is empty)

 

With this it ads more to the script to limit just how much water you can flow, Hydrants have limits to you know! 

 

That's cool. Glad to see some people are playing around with the scripts. That's exactly why those values can be found on top, so you can change them easily. :) It kinda depends how much realism you want. To keep a better gameplay balance, I would've personally turned those outtake values a bit down so the water tank doesn't empty in only 10-11 seconds with 3 hoses.

Link to comment
Share on other sites

Demo looks great. Freeplay crashed on load, so I don't know if you hadn't finished it in the last upload. Also noticed that you had the "guy on cannon" set up for those engines, nice to see that it can work for existing engines.

 

What did you come up with for connections to ladder trucks or the LAX Crash engine (though I'm assuming some prototype editing will be needed)? I thought of the humorous situation that will happen with the brush truck. One guy on the hose, then we'd have a guy waiting with a supply hose so when the tank is empty they'd have to switch to refill.

 

Also, anyone that has ideas for good values that get as close to how many lines a pump can support without draining the tank, please post.

Link to comment
Share on other sites

Demo looks great. Freeplay crashed on load, so I don't know if you hadn't finished it in the last upload. Also noticed that you had the "guy on cannon" set up for those engines, nice to see that it can work for existing engines.

 

What did you come up with for connections to ladder trucks or the LAX Crash engine (though I'm assuming some prototype editing will be needed)? I thought of the humorous situation that will happen with the brush truck. One guy on the hose, then we'd have a guy waiting with a supply hose so when the tank is empty they'd have to switch to refill.

 

Also, anyone that has ideas for good values that get as close to how many lines a pump can support without draining the tank, please post.

 

Hmm, I did finish the freeplay part and it doesn't crash on me. Do more people experience this?

Link to comment
Share on other sites

Doesn't crash on me either. I've got it set up and working in the Manhattan Mod, however the script only recognises the deck gun as an outsource and wont recognise the hydrant hookup as an intake..

 

The mod runs on the same system as the LA mod, and as far as I'm aware pretty much the same hydrant connect system.

Link to comment
Share on other sites

Doesn't crash on me either. I've got it set up and working in the Manhattan Mod, however the script only recognises the deck gun as an outsource and wont recognise the hydrant hookup as an intake..

 

The mod runs on the same system as the LA mod, and as far as I'm aware pretty much the same hydrant connect system.

 

Yes, but the hydrant connection system in this demo mod isn't the same as in LA Mod, where a custom script is used to spawn the connectors. In this demo mod, as well as the US Army Mod, it's the other way around. Instead of the custom connectors on a TLF vehicletype, a custom deck gun script is being used for GTF vehicletypes. I did this, so the deck gun's autotargeting functionality isn't enabled by default and so I could spawn a deck gun controller on top of the vehicle to add a little more realism. So if you want to get this script to work in the Manhattan Mod, you will have to change the fire engines, change their types to GTF, add the hose connectors as a superchild (remove the current cannon superchild) and create a custom deck gun script, like the one in this demo mod. Same thing for the LA Mod actually.

Link to comment
Share on other sites

Just finished a comprehensive instructional guide to implement the freeplay logic into other modifications. Check out the first post in this topic for the pdf file.

 

Hopefully, the information is clear enough and understandable. If not: sorry for my English

 

Feedback on the guide and this entire logic would be appreciated.

 

Hoppah

Link to comment
Share on other sites

I followed the guide and put everything in my mod the right way but when the loading bar fills up for Freeplay or Challenge mode i get a error code

Error: Unexpected EOF G_exec_statement()

 

Sounds like i pasted the script wrong

 

Was it one of the freeplay scripts that gave the error? Can you post the script here? :)

Link to comment
Share on other sites

Freeplay and Challenge mode give the same error,

Here is the script

 

bool OnLoad()
{
    start();
    System::SetEnv("e4_doocclusion", 0);
    Process::Kill();
    return true;
}

void start()
{
GameObjectList l1("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");    
{
    GameObjectList l1("fire_station_controlpanel");
    GameObject Obj = l1.GetObject(0);
    Game::ExecuteCommand("VcmdStart", &Obj);
    
    GameObjectList l2("spawn_check");
    if (l2.GetNumObjects() > 0)
    {
        GameObject obj = l2.GetObject(0);
        Game::ExecuteCommand("VcmdTillerCheck", &obj);
        obj.SetSelectable(false);
    } else
        System::Error("Spawn_check not found!");
};
Link to comment
Share on other sites

Freeplay and Challenge mode give the same error,

Here is the script

 

bool OnLoad()

{

    start();

    System::SetEnv("e4_doocclusion", 0);

    Process::Kill();

    return true;

}

void start()

{

GameObjectList l1("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");    

{

    GameObjectList l1("fire_station_controlpanel");

    GameObject Obj = l1.GetObject(0);

    Game::ExecuteCommand("VcmdStart", &Obj);

    

    GameObjectList l2("spawn_check");

    if (l2.GetNumObjects() > 0)

    {

        GameObject obj = l2.GetObject(0);

        Game::ExecuteCommand("VcmdTillerCheck", &obj);

        obj.SetSelectable(false);

    } else

        System::Error("Spawn_check not found!");

};

 

There is one { too much and GameObjectList l1 exists twice (first to get 'water_supply_main', then again to get 'fire_station_controlpanel').

 

So try this one:

bool OnLoad(){	start();	System::SetEnv("e4_doocclusion", 0);	Process::Kill();	return true;}void start(){	GameObjectList l3("water_supply_main");	if(l3.GetNumObjects() > 0)	{		GameObject Obj1 = l3.GetObject(0);		Game::ExecuteCommand("DummyCheckWaterSupply", &Obj1);		System::Log("WATER, Start DummyCheckWaterSupply");	} else        System::Log("WATER, Can not find object with name: water_supply_main");	GameObjectList l1("fire_station_controlpanel");	GameObject Obj = l1.GetObject(0);	Game::ExecuteCommand("VcmdStart", &Obj);		GameObjectList l2("spawn_check");	if (l2.GetNumObjects() > 0)	{		GameObject obj = l2.GetObject(0);		Game::ExecuteCommand("VcmdTillerCheck", &obj);		obj.SetSelectable(false);	} else		System::Error("Spawn_check not found!");};
Link to comment
Share on other sites

Important message:

 

This demo mod and its script logic is NOT fully compatible with the LA Mod. The fire engine's in the LA Mod make use of a custom hose connection script which is not compatible with the limited water logic. I can't really take all the custom stuff into account, can I? That would make the scripts way too complicated again.

 

In order to make the LA Mod's fire engines compatible with the limited water supply logic, you will need to change the fire engine's vehicletype to GTF, remove the deck gun superchild and add 4 hose connection superchilds. After that, see if everything works and then use a custom deck gun script to also get a functional deck gun again. The demo mod comes with custom deck gun script, but that one has to be changed to work with the LA Mod's fire engine's.

Link to comment
Share on other sites


//******************************************************************************************

// #Version 1.1#

//

// Script by Hoppah

//

// Usage of this script in other mods is NOT allowed without permission of Hoppah

//

//******************************************************************************************

 

bool OnLoad()

{

start();

System::SetEnv("e4_doocclusion", 0);

Process::Kill();

return true;

}

 

void start()

{

GameObjectList l1("fs1_cp");

if (l1.GetNumObjects() > 0)

{

GameObject Obj = l1.GetObject(0);

Game::ExecuteCommand("VcmdStart", &Obj);

}

 

GameObjectList l2("random_check");

if (l2.GetNumObjects() > 0)

{

GameObject obj = l2.GetObject(0);

obj.SetUserData(1);

obj.Hide();

Game::ExecuteCommand("RandomSpawn", &obj);

}

};


 

Help as is??

Link to comment
Share on other sites

 

//******************************************************************************************
// #Version 1.1#
//
// Script by Hoppah
//
// Usage of this script in other mods is NOT allowed without permission of Hoppah
//
//******************************************************************************************
 
bool OnLoad()
{
start();
System::SetEnv("e4_doocclusion", 0);
Process::Kill();
return true;
}
 
void start()
{
GameObjectList l1("fs1_cp");
if (l1.GetNumObjects() > 0)
{
GameObject Obj = l1.GetObject(0);
Game::ExecuteCommand("VcmdStart", &Obj);
}
 
GameObjectList l2("random_check");
if (l2.GetNumObjects() > 0)
{
GameObject obj = l2.GetObject(0);
obj.SetUserData(1);
obj.Hide();
Game::ExecuteCommand("RandomSpawn", &obj);
}
};
 
Help as is??

 

 

Did u actually read the guide? It clearly says you have to add a part, but you didn't even try. It really aint that hard.  :huh:

 

Use this:

bool OnLoad(){	start();	System::SetEnv("e4_doocclusion", 0);	Process::Kill();	return true;}void start(){	GameObjectList l3("water_supply_main");	if(l3.GetNumObjects() > 0)	{		GameObject Obj1 = l3.GetObject(0);		Game::ExecuteCommand("DummyCheckWaterSupply", &Obj1);		System::Log("WATER, Start DummyCheckWaterSupply");	} else	System::Log("WATER, Can not find object with name: water_supply_main");	GameObjectList l1("fs1_cp");	if (l1.GetNumObjects() > 0)	{		GameObject Obj = l1.GetObject(0);		Game::ExecuteCommand("VcmdStart", &Obj);	}	GameObjectList l2("random_check");	if (l2.GetNumObjects() > 0)	{		GameObject obj = l2.GetObject(0);		obj.SetUserData(1);		obj.Hide();		Game::ExecuteCommand("RandomSpawn", &obj);	}}; 

Link to comment
Share on other sites

Hoppah have in mind to make a scritp to attach a tank to another tank??

 

2 tanks that collide, you can find that here: http://www.ventube.com/wp-content/uploads/2012/10/HD-Tank-Collision-Wallpaper-Backgrounds.jpeg To attach them you need welding equipment however.

 

Seriously:

 

I do think it's possible, but it's not on my to-do list yet. I don't have a tanker model either, but I guess you could hook up a hose to the tanker first and then to the fire engine's supply line connector to get it work.

 

Make me beautiful tanker, I make you beautiful script.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...