Jump to content
Hoppah

[Released] Limited Water Supply Logic

Recommended Posts

Answered one question of mine.

Another thing about the brush truck. Since I've got a crew of two, how can it be worked so that they both get out, one hooks a hose while the other just connects a supply?

 

Looks like that's how it works already, though the second guy still gets another hose afterwards. I'd like to make him either not get the hose, or get an extinguisher instead.

 

Hoppah, what kind of max range is safe for the hookup hydrant search? I suppose max reach of the hoses, but I don't know how that would pan out to the number in the script.

Link to comment
Share on other sites

Ah, missed that. Hopefully that will be it, or at least let me hit any other errors on the way.

 

Edit: Nope, no change, still the same errors in the log and nothing working. All missing semi-colons were added, so it's something else that isn't actually bringing up an error.

attachicon.gif WaterSupplyFreeplay.rar

 

Found another mistake in the script:

            else if (StrCompare(v.GetPrototypeFileName(), VEH_CRASH) == 0 || v.GetPrototypeFileName(), VEH_CRASH2) == 0 || StrCompare(v.GetPrototypeFileName(), VEH_FOAM) == 0)

You forgot to add 'StrCompare(' in front of the VEH_CRASH2 part, so that line should look like:

            else if (StrCompare(v.GetPrototypeFileName(), VEH_CRASH) == 0 || StrCompare(v.GetPrototypeFileName(), VEH_CRASH2) == 0 || StrCompare(v.GetPrototypeFileName(), VEH_FOAM) == 0)

If that still doesn't fix your issue, I suggest you switch back to the original script and see if that one works.

 

 

Haha, how peculiar? Whats up with your supply monitor? Mine works great  :) although I'm not using the deck gun  :)

 

Edit, having some issues trying to stop the 4th guy hooking up again after he adds the supply line. Any help would be appreciated, I'm guessing it's something to do with child 3 of the attatch firehose script, but I'm dumbfounded haha

 

Is the script LAEquipmentCommands.script present in the Manhatter Modie? If so, the following advice applies:

 

As for the disappearing attachhose/removehose commands. Open up LAEquipmentCommands.script and delete all lines that involve those 2 commands.

 

 

 

 

I think it's one of those pushactions that would control it. Comment out one of the lines and see what effect it has.

 

As for another problem of mine, my tender waterswitch doesn't want to work correctly. It activates and deactivates fine, but it won't extinguish or cool. I wonder if setting the cannon vehicle it creates to the LPF type instead of TLF is causing issues. I'd like the tender and my crash engines to have the more powerful deck gun so they have a difference between the regular engines.

 

I suggest you first get everything to work using the reguler and adviced settings, thus a TLF vehicletype for the watercannon vehicle.

 

 

Freakinmusket did make one for his LA County submod.

 

Frkng cool. I'll take a look into that.

 

 

Hoppah, what kind of max range is safe for the hookup hydrant search? I suppose max reach of the hoses, but I don't know how that would pan out to the number in the script.

 

I don't know what the maximum reach of the hoses is and the logic searches for the closest hydrant directly, regardless of objects in the way. If you'd use the absolute maximum of a stretched hose and the fire fighter has to move around objects before he can attach the hose, he won't make it to the engine. Know what I mean?

 

 

 

For everyone having issues with the script: I suggest you do not make any personal changes to the scripts before you get it to work with the default scripts from the demo mod. After that, start making personal changes slowly.

Link to comment
Share on other sites

Yes, I can kind if I want to.  :happy:

 

To get the cannon to deactivate you will have to add a little 'fake' animation to the vehicle. Open the main .v3o file of the vehicle (fire_engine1.V3O / fire_engine2.V3O) and add the following at the bottom of the file:

M, activate0, 1M, deactivate0, 1

That's all. The script uses the animation to check if the watercannon is either activated or not. The animation itself doesn't do anything visually, it's just another check.

 

Hereweard Fyning's WaterSwitch.script seems to look fine. :)

 

As for the disappearing attachhose/removehose commands. Open up LAEquipmentCommands.script and delete all lines that involve those 2 commands.

That worked, Hoppah!

Thanks every thing is running smoothly now!

Link to comment
Share on other sites

YvEN9.png

 

 

I just removed the push action for attach hose 3 and it sorted it out I prefer that guy to act as a pump monitor for realism :)

Awesome work

 

You're welcome. There's 3 reasons why I switched to a custom water cannon command instead of a custom hose connections command: 1. a disabled water cannon on the engine's by default. 2. the controller guy  that spawns on the roof for a more realistic feeling, (although he's only there for aesthectic purposes) 3. easier script implementation (the custom hose connections script in the LA Mod was more complex).

 

That worked, Hoppah!

Thanks every thing is running smoothly now!

 

Glad to hear that too.

 

 

Apparently, the files provided in the second demo release seem to work smoothly. :)

 

I probably won't work on this demo mod for a while, although I will take the following ideas and improvements into consideration for a future update:

1. Enable/disable pumps command. You would need to enable the pumps on each engine (in EM4 jargon: each GTF vehicletype) first, before you can use any hose connection and need to disable the pumps before the engine can move again. The command would require at east one fire fighter to control the pump/engine. The command will probably get 'rapid deployment'-command compatibility too, so one of the fire fighters will enable to pumps and act as a controller.

2. Hose extension command, basically the gated wye logic, but with only 1 hose connection instead of 2 (lol), so you can have longer hoses.

3. Water tanker logic. The tanker could act as a hydrant substitute in areas without hydrants. Beside that, I will definately NOT do an engine to engine supply line command, because a hydrant connected to engine 1 which is connected to engine 2 (so engine 2 gets water from engine 1) is 1. total bullshit in EM4, 2. kinda complex to script and 3. just simply isn't necessary and 4. nobody would probably use it. A simple water tanker with only 1 hose connection which can be used to supply a single engine shouldn't be that hard to script and would give modifications another unique feature.

 

The only thing I do not like in the demo mod are the provided water level icons (for the freeplay variant). If there's anyone who's willing to make new and better looking icons, feel free to release them. I made mine in Photoshop and I think the .psd file can still be found in the "...\Limited Water Supply Test Mod\Ui\Game\Icons\" folder.

 

 

Also, is the pdf guide clear enough, or is it hardly understandable or are there so many textual errors you'd rather kill yourself?

 

 

Hophop

Link to comment
Share on other sites

YvEN9.png

 

 

 

You're welcome. There's 3 reasons why I switched to a custom water cannon command instead of a custom hose connections command: 1. a disabled water cannon on the engine's by default. 2. the controller guy  that spawns on the roof for a more realistic feeling, (although he's only there for aesthectic purposes) 3. easier script implementation (the custom hose connections script in the LA Mod was more complex).

 

 

Glad to hear that too.

 

 

Apparently, the files provided in the second demo release seem to work smoothly. :)

 

I probably won't work on this demo mod for a while, although I will take the following ideas and improvements into consideration for a future update:

1. Enable/disable pumps command. You would need to enable the pumps on each engine (in EM4 jargon: each GTF vehicletype) first, before you can use any hose connection and need to disable the pumps before the engine can move again. The command would require at east one fire fighter to control the pump/engine. The command will probably get 'rapid deployment'-command compatibility too, so one of the fire fighters will enable to pumps and act as a controller.

2. Hose extension command, basically the gated wye logic, but with only 1 hose connection instead of 2 (lol), so you can have longer hoses.

3. Water tanker logic. The tanker could act as a hydrant substitute in areas without hydrants. Beside that, I will definately NOT do an engine to engine supply line command, because a hydrant connected to engine 1 which is connected to engine 2 (so engine 2 gets water from engine 1) is 1. total bullshit in EM4, 2. kinda complex to script and 3. just simply isn't necessary and 4. nobody would probably use it. A simple water tanker with only 1 hose connection which can be used to supply a single engine shouldn't be that hard to script and would give modifications another unique feature.

 

The only thing I do not like in the demo mod are the provided water level icons (for the freeplay variant). If there's anyone who's willing to make new and better looking icons, feel free to release them. I made mine in Photoshop and I think the .psd file can still be found in the "...\Limited Water Supply Test Mod\Ui\Game\Icons\" folder.

 

 

Also, is the pdf guide clear enough, or is it hardly understandable or are there so many textual errors you'd rather kill yourself?

 

 

Hophop

The guide is very follow able! 

However due to the lack of information on the deck gun side of it, It would be a little easier to follow just removing any reference to it at all as far as the combination trucks!

 

Side Note - Hoppah would you have any complaints if i did a tutorial guide for the combination engines?

Link to comment
Share on other sites

Anything that helps would be appreciated! I'm an experienced modder and English isn't my mother tongue. Some details seem very logical to me, but may be still worth a mention in guides. So writing a tutorial that's understandable for the inexperienced users is very time-consuming for me (the pdf guide took about 3-4 hours lol).

Link to comment
Share on other sites

 

 

Found another mistake in the script:

You forgot to add 'StrCompare(' in front of the VEH_CRASH2 part, so that line should look like:

If that still doesn't fix your issue, I suggest you switch back to the original script and see if that one works.

 

 

I suggest you first get everything to work using the reguler and adviced settings, thus a TLF vehicletype for the watercannon vehicle.

 

I don't know what the maximum reach of the hoses is and the logic searches for the closest hydrant directly, regardless of objects in the way. If you'd use the absolute maximum of a stretched hose and the fire fighter has to move around objects before he can attach the hose, he won't make it to the engine. Know what I mean?

 

I noticed and fixed the missing code for the compare, but the issue happened before I added that one. I'll see about redoing my formatting to see if I can spot errors easier.

 

Yeah, I'll switch back to TLF, though I'm surprised the other type wouldn't work just as well.

 

Point on the hose thing. It does really seems to short, so I'll mess around with the distance check.

 

You're welcome. There's 3 reasons why I switched to a custom water cannon command instead of a custom hose connections command: 1. a disabled water cannon on the engine's by default. 2. the controller guy  that spawns on the roof for a more realistic feeling, (although he's only there for aesthectic purposes) 3. easier script implementation (the custom hose connections script in the LA Mod was more complex).

 

I probably won't work on this demo mod for a while, although I will take the following ideas and improvements into consideration for a future update:

1. Enable/disable pumps command. You would need to enable the pumps on each engine (in EM4 jargon: each GTF vehicletype) first, before you can use any hose connection and need to disable the pumps before the engine can move again. The command would require at east one fire fighter to control the pump/engine. The command will probably get 'rapid deployment'-command compatibility too, so one of the fire fighters will enable to pumps and act as a controller.

2. Hose extension command, basically the gated wye logic, but with only 1 hose connection instead of 2 (lol), so you can have longer hoses.

3. Water tanker logic. The tanker could act as a hydrant substitute in areas without hydrants. Beside that, I will definately NOT do an engine to engine supply line command, because a hydrant connected to engine 1 which is connected to engine 2 (so engine 2 gets water from engine 1) is 1. total bullshit in EM4, 2. kinda complex to script and 3. just simply isn't necessary and 4. nobody would probably use it. A simple water tanker with only 1 hose connection which can be used to supply a single engine shouldn't be that hard to script and would give modifications another unique feature.

 

The only thing I do not like in the demo mod are the provided water level icons (for the freeplay variant). If there's anyone who's willing to make new and better looking icons, feel free to release them. I made mine in Photoshop and I think the .psd file can still be found in the "...\Limited Water Supply Test Mod\Ui\Game\Icons\" folder.

 

 

Also, is the pdf guide clear enough, or is it hardly understandable or are there so many textual errors you'd rather kill yourself?

 

I like this method much more than what was used for the US mods. Much better.

 

All those ideas sound great. Though if we get pumps to operate, I'll be running out of people to do it. That's also exactly what I was thinking for how the tanker would work.

 

Guide wasn't bad really. There were some oddities, but it's understandable.

Link to comment
Share on other sites

The hose extension idea, something I've wanted to do for some time. Would it be doable if I simply changed the script to allow one connection, I'd need to look at the script but I'm guessing it references 2 child names that it connects to or something similar, would changing the model and removing on of the reference points make it a 1:1 hookup?

Link to comment
Share on other sites

The hose extension idea, something I've wanted to do for some time. Would it be doable if I simply changed the script to allow one connection, I'd need to look at the script but I'm guessing it references 2 child names that it connects to or something similar, would changing the model and removing on of the reference points make it a 1:1 hookup?

 

The wye script basically spawns a tiny GTF vehicletype model with only 2 hose connections. It's fairly easy to change that to only 1 hose connection (which would be the extension object), however an extended script to have the fire fighter automatically reattach the hose to the extension object would be the thing you want to give it the best result.

Link to comment
Share on other sites

The wye script basically spawns a GTF with only 2 hose connections. It's fairly easy to change that to only 1 hose connection (which would be the extension object), however an extended script to have the fire fighter automatically reattach the hose to the extension object would be the thing you want the give it the best result.

 

makes sense, I'll look into that for a simple fix myself :)

Link to comment
Share on other sites

makes sense, I'll look into that for a simple fix myself :)

 

Cool, but still that wouldn't make it compatible with the limited water logic though.  :blush: Every single addition (especially when they're custom made) requires a change in the limited water script. That's why I did add the custom water cannon (or deck gun) to this demo mod, so there is at least 1 way to have the combination of a GTF+TLF that'll work with the limited water logic. It gives mod-creators who want to do an American mod at least a way to add fire engine's to their mods that feel more realistic.

Link to comment
Share on other sites

Cool, but still that wouldn't make it compatible with the limited water logic though.  :blush:

 

Ah yeah I hadn't thought about that.

I have perhaps found a bug, don't know if anyone else has had it too. When I remove the hose from the rig and then from the hydrant my firefighter is left with the hose still equipped and able to attatch, but not actually able to drop it. Any ideas? 

Link to comment
Share on other sites

Ah yeah I hadn't thought about that.

I have perhaps found a bug, don't know if anyone else has had it too. When I remove the hose from the rig and then from the hydrant my firefighter is left with the hose still equipped and able to attatch, but not actually able to drop it. Any ideas?

Adding the RemoveEquipment command to your people should be all you need to do.
Link to comment
Share on other sites

Okay so i think i found a bug or two!

Maybe i just messed up something and its a easy fix!

 

Bug 1

 

If you have engine A, B, C, and D ( combination engines using waterswitch.script )

 

And they are all flowing deck guns when engine A runs out of water B,C and D also stop flowing water!

 

Bug 2

 

If the tank on the Ladder runs empty and you then hook a supply line to same the ladder is still unable to flow water again

Link to comment
Share on other sites

Well, I definitely borked something trying to customize the script last time, but I restored the default script, made a few slight changes (can't get things completely as I'd like them just yet), and I have my limited water working.

 

Fixed my Tender cannon by changing the prototype back to TLF, but I believe I found the issue in the extinguish and cool scripts that was keeping the LPF type from working, so I'll see if I can switch it back...

 

And it worked! Just find the line below in both scripts...

if (obj.GetUserData() == UnitID && obj.CheckExtinguishDistance(o) && obj.GetVehicleType()==VT_FIREFIGHTERS_TLF)

And change to this one...

if (obj.GetUserData() == UnitID && obj.CheckExtinguishDistance(o) && (obj.GetVehicleType()==VT_FIREFIGHTERS_TLF || obj.GetVehicleType()==VT_FIREFIGHTERS_LPF))

Now if you want, you can have more powerful deck guns on vehicles! The energy settings are above that line in extinguish if you want to change values. If you want the correct cannon drain on the water supply, find the section under this...

if (v.GetVehicleType() == VT_FIREFIGHTERS_GTF && v.HasCommand("VcmdWaterSwitch") && v.IsCurrentAnimation("activate"))

And make it look something like this (changing (and adding const if needed) the prototype checks as needed)

if (cannon.GetUserData() == v.GetID() && (cannon.IsCurrentAction("EActionExtinguish") || cannon.IsCurrentAction("EActionCool")))   {      if (StrCompare(v.GetPrototypeFileName(), VEH_FOAM) == 0 || StrCompare(v.GetPrototypeFileName(), VEH_CRASH) == 0 || StrCompare(v.GetPrototypeFileName(), VEH_CRASH2) == 0)          numActiveLPFCannons++;      else          numActiveTLFCannons++;   }
Bug 1

Bug 2

Haven't run into either, but Bug 1 makes sense, as all the cannon vehicles it creates are named the same; there should be a way to keep them separate I assume. Haven't a clue about number 2, but I can confirm it.

 

Have a bug of my own.

Sometimes when removing the supply line, a person will switch prototypes! I've had SCBA and non-SCBA switching switching to the other.

Link to comment
Share on other sites

Haven't run into either, but Bug 1 makes sense, as all the cannon vehicles it creates are named the same; there should be a way to keep them separate I assume. Haven't a clue about number 2, but I can confirm it.

 

Have a bug of my own.

Sometimes when removing the supply line, a person will switch prototypes! I've had SCBA and non-SCBA switching switching to the other.

 

The name has almost nothing to do with finding the right cannon. Upon installing the cannon the unique vehicle-ID gets assigned as UserData to the cannon, so it should find the correct cannon. I'll take a look into the demo mod soon.

 

The the bug with the switching prototypes is caused because when you install the supply the person gets hidden and its prototype is copied and respawns. When you remove the supply line that hidden person shows again.

Link to comment
Share on other sites

The name has almost nothing to do with finding the right cannon. Upon installing the cannon the unique vehicle-ID gets assigned as UserData to the cannon, so it should find the correct cannon. I'll take a look into the demo mod soon.

 

The the bug with the switching prototypes is caused because when you install the supply the person gets hidden and its prototype is copied and respawns. When you remove the supply line that hidden person shows again.

Just for giggles i went and check the Demo Mod and...

Bug 1 also occurs in it!

 

If engine A flows its deck gun and engine B flows its deck gun 45 seconds later,

Then engine A's tank goes empty engine B's deck gun also gets disabled

If engine A then has a supply line hocked up both deck guns flow again until

engine B's tank goes empty then both deck guns are once again disabled regardless of the water supply being hocked to engine A

If you then put a water supply to engine B both deck guns resume working.

( On a side not this thankfully dose not effect hose connections and handlines)

Link to comment
Share on other sites

The name has almost nothing to do with finding the right cannon. Upon installing the cannon the unique vehicle-ID gets assigned as UserData to the cannon, so it should find the correct cannon. I'll take a look into the demo mod soon.

 

The the bug with the switching prototypes is caused because when you install the supply the person gets hidden and its prototype is copied and respawns. When you remove the supply line that hidden person shows again.

Ah, alright. It was an uneducated guess based on the wording in the script.

 

So when I have a SCBA guy install the line and a non-SCBA guy uninstall it, that's what happens. Alright, bug makes sense.

 

Thanks, you're right. I think I've fixed the issue in the script.

Sounds great!

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