Jump to content


Photo

[Released] Limited Water Supply Logic


  • Please log in to reply
253 replies to this topic

#161 The Loot

The Loot

    Battalion Chief

  • Members
  • 725 posts
  • Gender:Male

Posted 01 September 2013 - 03:25 AM

Hoppah, quick semi-related question. I'm tweaking the extinguish values for various sources. I believe I found the normal firehose value here.

float Energy = (Caller->GetEquipment()==EQUIP_FIREHOSE) ? 20.0f : 12.5f;
            Caller->PushActionExtinguish(ACTION_APPEND, Target, Energy);

Now, in this section...

if(v.GetVehicleType()==VT_FIREFIGHTERS_TLF)
    Energy = 20.0f;
else if(v.GetVehicleType()==VT_FIREFIGHTERS_LPF)
    Energy = 30.0f;
else if(v.GetVehicleType()==VT_FIREFIGHTERS_FLB)
    Energy = 40.0f;
else
    Energy = 100.0f;

...does "else" end up just affecting, say, the Fire Plane? DLK types aren't mentioned there. The only thing I see of them is above that...

if (useDLKlogic)
        {
            Person p(Caller);
            if (p.GetEnteredCarTargetID() == -1)
            {
                Caller->PushActionTurnBase(ACTION_NEWLIST, Target);
                Caller->PushActionCannonExtinguish(ACTION_APPEND, Target, 25.f, false);
            }
            else
                Caller->PushActionCannonExtinguish(ACTION_NEWLIST, Target, 25.f, false);
            return;
        }

...but there's no mention of the energy value for the action there.

 



#162 Hoppah

Hoppah

    Boss cat

  • Administrators
  • 3,879 posts
  • Gender:Male
  • Location:Special Needs Department

Posted 01 September 2013 - 03:24 PM

Yes, I believe the 100.f is for the Fire Plane, but Im not sure since I never really played with those values.

 

 

Here's a screenshot of the current update I'm working on. You can see the new water tanker (thanks to FreakingMusket for the model!) and its connection to the fire engine.

However, the water tanker feature is not finished yet since I've ran into some issues  :( . After I fixed that, I still need to convert the logic for the freeplay version, but shouldn't be too hard.

 
Attached File  Em4Deluxe 2013-09-01 16-03-34-96.jpg   0bytes   1 downloads
 

The guy behind the fire engine is the guy who controls the pumps. Without this 'controllor' you will not be able to use the hoses on the engine.

 

Hoppah



#163 CFDDIVE11

CFDDIVE11

    Captain

  • Members
  • 171 posts
  • Gender:Male

Posted 01 September 2013 - 05:25 PM

So is this going to be incorporated into a mod and then released? Because how are we going to use the tanker if we put this script into another mod?


Signature Removed due to size


#164 Rafael

Rafael

    Senior Captain

  • Members
  • 347 posts
  • Gender:Male
  • Location:São Paulo / Brazil

Posted 01 September 2013 - 06:24 PM

Very good!! I'm implementing a new version of São Paulo Mod, with this script, and I'm anxious to see the new version with the possibility to connect to power other tanker trucks!!



#165 Hoppah

Hoppah

    Boss cat

  • Administrators
  • 3,879 posts
  • Gender:Male
  • Location:Special Needs Department

Posted 01 September 2013 - 06:43 PM

So is this going to be incorporated into a mod and then released? Because how are we going to use the tanker if we put this script into another mod?

 

This demo mod is basically open source. Just like the current version that can be downloaded, I will release a new demo mod with the new features. You can try out or test the demo mod to see how it works. The scripts can be copied to other mods. Implementation in other modifications isn't that hard if you know what you're doing, I've already written a guide how to do that and which files are necessary. Someone else also made a guide with screenshots.

 

 

H



#166 Hoppah

Hoppah

    Boss cat

  • Administrators
  • 3,879 posts
  • Gender:Male
  • Location:Special Needs Department

Posted 02 September 2013 - 12:05 AM

I think I got most of the new features to work in freeplay as well. I still want to give it a few extra tests before the next demo mode can be released.

 

 

Summarized, the new update will contain the following new features:

 

- Water Tanker vehicle (model by Freakinmusket)

- Working water tanker functionality (you can supply fire engine's with the water tanker)

- Extend hose command for fire fighters

- 'Activate engine pump' command (to use hoses from an engine a fire fighter to control the pump panel is required)

- New icons

- Rapid deployment improvements + ladder vehicle compatibility

- Several minor changes and fixes under 'the hood' (VcmdWaterSwitch renamed to VcmdCannonSwitch to prevent confusions with other scripts)

 

Most of the scripts have been changed intensively for the water tanker functionality and the pump command, so if you have the logic already implemented in your mod, you probably need to do all the personal changes again unfortunately.

 

Hoppah



#167 The Loot

The Loot

    Battalion Chief

  • Members
  • 725 posts
  • Gender:Male

Posted 02 September 2013 - 03:07 AM

I think I got most of the new features to work in freeplay as well. I still want to give it a few extra tests before the next demo mode can be released.

 

 

Summarized, the new update will contain the following new features:

 

- Water Tanker vehicle (model by Freakinmusket)

- Working water tanker functionality (you can supply fire engine's with the water tanker)

- Extend hose command for fire fighters

- 'Activate engine pump' command (to use hoses from an engine a fire fighter to control the pump panel is required)

- New icons

- Rapid deployment improvements + ladder vehicle compatibility

- Several minor changes and fixes under 'the hood' (VcmdWaterSwitch renamed to VcmdCannonSwitch to prevent confusions with other scripts)

 

Most of the scripts have been changed intensively for the water tanker functionality and the pump command, so if you have the logic already implemented in your mod, you probably need to do all the personal changes again unfortunately.

 

Hoppah

- Awesome.

- I fear this will run into the same problem as the wye does for me. I think I'll just forget about the LA mods Barriers, Cones and Flares (I rarely use them anyways) and make sure to just take the pickup script straight from you.

- Pumps will add a welcome layer of complexity and strategy.

- Never had a problem with your icons, but I'm sure the new ones will be snazzy.

- Looking forward to the new deployment capabilities. Some hints on how to modify it personal liking would be welcome.

 

While I'll have to do some needed tweaking to new features, I'm confidant I can easily re-add my changes to the new version. Once again, thanks for the great work Hoppah.

 

Edit for Bug:

Hoppah, I've noticed that while vehicles that start spawned on the map work fine, vehicles that are spawned "off-map" through call scripts aren't getting the water system assigned to them. Will I need to manually assign the dummies in the call script, or is there a change to the water script that will work with that?

 

It seems to affect any vehicle spawned after the initial setup, either through menu or script.



#168 eyespy900

eyespy900

    Senior Captain

  • Members
  • 251 posts
  • Gender:Male

Posted 04 September 2013 - 01:12 AM

hi hoppah

 

i have a attach fire hose script that opens the rear doors of my fire engine when you connect a hose.  at the end of the script there are the open door parts.  where should i put this in the limited water supply script?

 

object AttachFireHose : CommandScript
{
    AttachFireHose()
    {
        SetValidTargets(ACTOR_OBJECT | ACTOR_VEHICLE);
        SetGroupID(CGROUP_FIREHOSE);
        SetGroupLeader(true);
        SetPossibleCallers(ACTOR_PERSON);
        SetPossibleEquipment(EQUIP_FIREHOSE);
        SetPossibleExists(CPE_FREE_HOSE_CONNECTION);
        SetNeedsConnectedHose(CFN_FAIL);
        SetRestrictions2(RESTRICT2_ISHYDRANT);
        SetPriority(220);
    }

    /*bool CheckPossible(GameObject *Caller)
    {
        if(!Caller->IsValid() || Caller->GetType() != ACTOR_PERSON)
            return false;
        return Caller->GetFirehoseID() == 0 && Caller->GetEquipment()==EQUIP_FIREHOSE && Game::ExistsFreeHoseConnection();
    }*/

    bool CheckGroupVisibility(GameObject *Caller)
    {
        if(!Caller->IsValid() || Caller->GetType() != ACTOR_PERSON)
            return false;
        return Caller->GetFirehoseID() == 0;
    }
    
    bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
    {
        if(!Caller->IsValid() || !Target->IsValid() || (Caller->GetID()==Target->GetID()))
            return false;
            
        if(Caller->GetFirehoseID())
            return false;
            
        if(Caller->GetType()!=ACTOR_PERSON)
            return false;
        Person c(Caller);
        if (c.GetEnteredCarID() != -1)
            return false;
            
        if(Caller->GetEquipment()==EQUIP_FIREHOSE)
        {
            if(Target->GetType() == ACTOR_OBJECT)
            {
                GameObject obj(Target);
                if(obj.IsHydrant() && !obj.IsHydrantInUse())
                    return true;
                return false;
            } else
            if(Target->GetType() == ACTOR_VEHICLE)
            {
                    Vehicle v(Target);
                    if(v.GetVehicleType() == VT_FIREFIGHTERS_GTF && v.GetEnergy() > 0.1f * v.GetMaxEnergy() && v.IsConnectorFree())
                        return true;
                    return false;
            }
        }

        return false;
    }

    void PushActions(GameObject *Caller, Actor *Target, int childID)
    {
        Caller->PushActionMove(ACTION_NEWLIST, Target, TARGET_FREE_CONNECTOR);
        if (Target->GetType() == ACTOR_VEHICLE)
            Caller->PushActionCheckFreeConnector(ACTION_APPEND, Target);
        Caller->PushActionUseEquipment(ACTION_APPEND, Target, childID, 1.0f);

        if (Target->GetType() == ACTOR_VEHICLE)
        {
            Vehicle v(Target);
            if (v.HasCommand("Cidea"))
            {
                v.EnableBlinker(BLT_BOTH);
                Game::ExecuteCommand("DUMMYOpenDoor1", &v, &v);
                Game::ExecuteCommand("DUMMYOpenDoor2", &v, &v);
            }
        }
    }
};
 



#169 sgtmatt325

sgtmatt325

    Captain

  • Members
  • 212 posts
  • Gender:Male
  • Location:Scranton PA
  • Interests:Firefighting
    Emergency 4
    Ford Trucks
    Sutphen Tower Ladders

Posted 04 September 2013 - 03:04 AM

Hey Hoppah

 

After i place the script in my mod i gave it to my friends to play and the water supply doesn't work on MP,

How hard will it be for you to make it work for MP


Lower Valley Mod Creator


#170 NathanDollinger

NathanDollinger

    Captain

  • Members
  • 170 posts
  • Gender:Male
  • Location:Asheville, NC, US
  • Interests:Games, Family, Fire Fighting ( Not in that order lol )

Posted 04 September 2013 - 04:37 AM

Hey Hoppah

 

After i place the script in my mod i gave it to my friends to play and the water supply doesn't work on MP,

How hard will it be for you to make it work for MP

This is simple!

 

Go under the missions folder in the scripts 

Copy the fp_challenge and fp_freeplay

paste

and rename copy's to

mp_challenge and mp_freeplay

and they will work in multiplayer


banner.jpg


#171 sgtmatt325

sgtmatt325

    Captain

  • Members
  • 212 posts
  • Gender:Male
  • Location:Scranton PA
  • Interests:Firefighting
    Emergency 4
    Ford Trucks
    Sutphen Tower Ladders

Posted 04 September 2013 - 04:48 AM

This is simple!

 

Go under the missions folder in the scripts 

Copy the fp_challenge and fp_freeplay

paste

and rename copy's to

mp_challenge and mp_freeplay

and they will work in multiplayer

Hehe :blush: Opps forgot about that
.

Thanks Nathan :holdglass:


Lower Valley Mod Creator


#172 CFDDIVE11

CFDDIVE11

    Captain

  • Members
  • 171 posts
  • Gender:Male

Posted 04 September 2013 - 03:31 PM

So i downloaded the script and i put it in the scripts folder and nothing happened?


Signature Removed due to size


#173 squamishfire

squamishfire

    Senior Captain

  • Members
  • 322 posts
  • Gender:Male
  • Location:Canada

Posted 04 September 2013 - 03:45 PM

Thats because you have to go into the editor and edit all the models by adding and removing items on the vehicles.


RCMP Mod Staff Member

Former Fire Fighter (2006-2011)
Squamish Fire Resuce
Hall one Company 41 (on call 24-7)

#174 CFDDIVE11

CFDDIVE11

    Captain

  • Members
  • 171 posts
  • Gender:Male

Posted 04 September 2013 - 04:08 PM

Yeah i tried that it didn't work out so well lol but shouldn't the script be in a notepad file or a EM4 modification file?


Signature Removed due to size


#175 Hoppah

Hoppah

    Boss cat

  • Administrators
  • 3,879 posts
  • Gender:Male
  • Location:Special Needs Department

Posted 04 September 2013 - 09:50 PM

v1.2 released! Download link can be found on the first page: http://forum.emergen...logic/?p=258435

 

Em4Deluxe 2013-09-01 16-03-34-96.jpg
 

New features:

- Water Tanker vehicle (model by Freakinmusket)

- Working water tanker functionality (you can supply fire engine's with the water tanker)

- Extend hose command for fire fighters

- 'Activate engine pump' command (to use hoses from an engine a fire fighter to control the pump panel is required)

- New icons

- Rapid deployment improvements + ladder vehicle compatibility

- Several minor changes and fixes under 'the hood' (VcmdWaterSwitch renamed to VcmdCannonSwitch to prevent confusions with other scripts)

 

Gameplay instructions

 

Water Tanker

You can install 1 hose from the water tanker to a fire engine, as well as a supply line from a hydrant to the tanker. The water tanker can not be used to extinguish fires by itself.

 

Activate pumps

You cannot use any installed hose from a fire engine if the pumps are not activated. You can activate the pumps of an engine in 3 (yes 3, wtf) different ways:

- Use the 'Engine pumps on/off' command (requires a fire fighter in the vehicle). A fire fighter will exit the vehicle and take position at the pump panel.

- Use the 'Rapid Deployment' command. Besides the four fire fighters who install their hoses to the fire engine, a fifth fire fighter will exit the vehicle to control the pumps.

- Select an fire fighter who is not equipped and click on the engine after the hoses are installed.

You can deactivate the pump by simply giving the fire fighter who is controlling the pumps a new command, or to use either the 'Engine pumps on/off' or 'Rapid Deployment' command to deinstall the fire engine.

Note: it is not required to activate the pumps to use the deck gun of an engine.

 

Rapid deployment

Using 'rapid deploy' from the water tanker only works if the tanker is parked in the vicinity of a fire engine (and a hydrant). Two fire fighters will exit the vehicle and get a hose from the nearest fire engine. The first fire fighter will install a supply line from the tanker to the nearest fire engine. If a hydrant is in the vicinity of the tanker, the second fire fighter will install a supply line from that hydrant to the tanker in order to supply the tanker. 'Rapid undeploy' finds the nearest idle and unequipped fire fighter who will remove any install supply lines running from and to the water tanker.

 

Rapid deployment is also compatible with DLK-vehicletypes (ladders) now. Using 'Rapid deploy', a fire fighter will install a supply line (if a hydrant is close) to the ladder vehicle and enter the basket. The other fire fighters inside the ladder will get a variety of equipment (pneumatic scissors, fire extinguisher, chainsaw, axe, jumppad and fire hose). 'Rapid undeploy' will only deinstall the entire vehicle, which means the fire fighter in the basket will exit the basket, remove the supply line (if present) and enter the vehicle.

 

Important note for modders:

Compared to the previous version, a lot has been changed in the new version. Vehicles have new ('PcmdPumpSwitch') and reamed commands ('VcmdCannonSwitch)' and a new child (for the pump controller) too. In case you want to implement the entire functionality to your own modification, please be aware that any vehicle in your mod will probably not be fully compatible with v1.2 anymore.

 

Bugs in v1.2

 

- The fire fighter who spawns outside to control the pump of a fire engine may not be recognized (script wise) by the vehicle sometimes, resulting in connected firehoses not working. To fix this, simply select the fire fighter and click on the fire engine to activate the pump again.
- In a rare occasion, the water tanker may not be recognized by the script, resulting in a water tanker with fire engine traits (1000 gallon tank for example) and not being able to supply other vehicles. Especially after playing freeplay directly after the demo mission may cause this problem.

 

Hope you like this upgrade :)

 

Hoppah



#176 cops

cops

    Assistant Chief

  • Members
  • 1,666 posts
  • Gender:Male

Posted 04 September 2013 - 11:03 PM

this looks so cool! 
Thank you Hoppah  :cheers:


QHVZAKw.png

 

**NOTE**

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

Red Watch (RCMP)


#177 sgtmatt325

sgtmatt325

    Captain

  • Members
  • 212 posts
  • Gender:Male
  • Location:Scranton PA
  • Interests:Firefighting
    Emergency 4
    Ford Trucks
    Sutphen Tower Ladders

Posted 05 September 2013 - 12:51 AM

Now the question remains....How hard will it be to place in a mod

Yes i understand you said "please be aware that any vehicle in your mod will probably not be fully compatible with v1.2 anymore"


Lower Valley Mod Creator


#178 Brandon Murphy

Brandon Murphy

    Firefighter

  • Members
  • 20 posts
  • Gender:Male
  • Location:Nanticoke, Pennsylvaina
  • Interests:Firefighting, Emergency Medical Services, Police, Fire/Rescue, FDNY:EMS, FDNY, NYPD, CFD, CFD:EMS, CPD, LAFD, LAFD:EMS, LAPD.

Posted 05 September 2013 - 12:55 AM

Yes, that would be nice to know, if possible.


Station 95

Firefighter

Website: http://station95.webs.com


#179 The Loot

The Loot

    Battalion Chief

  • Members
  • 725 posts
  • Gender:Male

Posted 05 September 2013 - 12:59 AM

Sounds great. Haven't found any real obstacles with scripts just yet; haven't got to the big scripts just yet, other than rapid deployment, though.

I'm beginning to think that simply releasing my edited scripts will be easier than going step by step with all my edits.

Quick Q Hoppah? Will it be a simple copy paste for the equipment actions on deployment if I want to apply it to GTF vehicles, or will some change to the function be needed?

#180 paulo ve

paulo ve

    Captain

  • Members
  • 205 posts

Posted 05 September 2013 - 01:06 AM

Hello Hoppah
How to apply for more than one tank in the mod?
Example 2 tank trucks!