Jump to content
olevla

Pump Vehicle

Recommended Posts

The limited water supply logic comes with a custom deck gun commandscript. That one works fine (even without limited water logic), just make sure to read the documentation. You would only have to copy the script that controls the deck gun n leave out the rest of the limited water scripts.

Alternatively you can also use the LA mod's version, which is a bit different but works fine.

Link to comment
Share on other sites

Folder Dir:

Game install path\Mods\La Mod folder\Scripts\Game\Command\

filename:

attatchfirehose.script

edit that script if you wish to use the LA mod version of the script.

 

You will have to get the removefirehose.script as well

Link to comment
Share on other sites

What did you exactly do?

Your goal is to make GTF/TLF combination. The GTF type with 4 hoses + TLF type with the water cannon.

There's 2 ways to do that:

- Use a GTF type + script to spawn TLF cannon. Use the custom script from the limited water then. I'd say that one is easier to use.

- Use a TLF type + script to spawn GTF hose connections. That's the way it's done in the LA Mod.

I'd like you to give some additionals details, otherwise we cannot help you.

Link to comment
Share on other sites

What did you exactly do?

Your goal is to make GTF/TLF combination. The GTF type with 4 hoses + TLF type with the water cannon.

There's 2 ways to do that:

- Use a GTF type + script to spawn TLF cannon. Use the custom script from the limited water then. I'd say that one is easier to use.

- Use a TLF type + script to spawn GTF hose connections. That's the way it's done in the LA Mod.

I'd like you to give some additionals details, otherwise we cannot help you.

 

I choose TLF type...

 

Em42014-03-2521-35-14-51_zps054adfc4.jpg

Link to comment
Share on other sites

What did you exactly do?

Your goal is to make GTF/TLF combination. The GTF type with 4 hoses + TLF type with the water cannon.

There's 2 ways to do that:

- Use a GTF type + script to spawn TLF cannon. Use the custom script from the limited water then. I'd say that one is easier to use.

- Use a TLF type + script to spawn GTF hose connections. That's the way it's done in the LA Mod.

I'd like you to give some additionals details, otherwise we cannot help you.

 

Or which is the limited water script ?...WaterSupplyFreeplay?Waterswitch?

 

Still can't fix the vehicle...

Link to comment
Share on other sites

If you used the limited water supply script which I think you did you have to use the type GTF

I know that but i don't know which file is limited water supply script.. (WaterSupplyFreeplay.script?Waterswitch.script?)

Link to comment
Share on other sites

The custom deck gun script should work independently of the limited water logic, so you don't need need the entire package.

You only need the file Waterswitch.script to get a water cannon to work + some prototype file changes/additions:

1. You will need to add childs to the vehicle that are named "controller" and "cannon".

2. You also need a seperate prototype which will spawn the TLF cannon.

I suggest you look at the way I did it with the example vehicle in the demo mod of the limited water to get the idea.

Link to comment
Share on other sites

The custom deck gun script should work independently of the limited water logic, so you don't need need the entire package.

You only need the file Waterswitch.script to get a water cannon to work + some prototype file changes/additions:

1. You will need to add childs to the vehicle that are named "controller" and "cannon".

2. You also need a seperate prototype which will spawn the TLF cannon.

I suggest you look at the way I did it with the example vehicle in the demo mod of the limited water to get the idea.

 

 

"controller" and "cannon" is child not super? What is controller?

Link to comment
Share on other sites

Use a hose connector as the child "controller" (it is where the guy will stand when manning the pump) and the cannon is also a child, not a superstructure. 

Link to comment
Share on other sites

It has to be a GTF type vehicle, with an object as a child named "controller" as a child, and the water cannon as a child named "cannon" The vehicle must be setup to mimic a regular pump from my understanding of the script.

Link to comment
Share on other sites

The cannon dosen't work  :nein:

Did you actually try to look how the vehicles are set up in the limited water demo mod? Too be honest, you do not provide much information, so we keep running around in circles providing you the basic information only. If you just compare the prototypes in the limited water demo mod with yours I'm sure you can figer it out.

Summarized, this is how you're supposed to set up the vehicle and get it to work with the Waterswitch.script (to spawn a custom water cannon on a GTF vehicletype).

1. GTF vehicletype with a maximum of 4 hose connections added as superstructures (which is the default setup of a regular GTF)

2. Add two childs, the first child is a deck gun model and named "cannon". The second child is only used to define the position of the fireman on the roof who is controlling the deck gun. Hence the name of that child is "controller". You can use any object for that.

3. Add 'VcmdCannonSwitch' to the vehicle too

4. Also, make a second vehicle prototype (TLF type) with an invisible model and the cannon added as a superstructure on the same position as the child in step 2. So, in the editor, the only thing you see is a floating water cannon.

If you have no idea what I mean, take a look at the prototypes in the limited water mod. It's really simple.

So how does the script work with all this? The script simply hides the child "cannon", spawns the second TLF type of top of the prototype (so you have a cannon that works) and spawns a fireman on the roof of the vehicle too.

That's all, it really aint too hard to understand this imo.

Link to comment
Share on other sites

You really try to see how the vehicles are set in the limited water resources demonstration MOD? Too honest, you do not provide too much information, so we keep the rush to provide you with only basic information. If you're just in a more limited water mold with your prototype demonstration, I'm sure you can Figer out. Summary, this is how you should set the vehicle and get it Waterswitch.script work (to generate a custom water cannons on the GTF vehicletype). 1. GTF vehicletype, up to 4 hose connection is added as a superstructure (this is the default setting an ordinary GTF) 2. Add two children, the first child is a deck gun model, named "cannon." Second child who is only used to define the control deck gun roof firefighter position. Therefore, the child's name is "Controller." You can use any object. 3. Add "VcmdCannonSwitch 'to 4 vehicles too. Also, the second car prototype (TLF type) model with an invisible and cannons added as a child in the same position in step 2 of the superstructure, therefore, in the editing is the only thing you see is a floating water cannons if you do not know what I'm saying, look at the prototype in a limited water change machine which is really very simple. So, how to work with all this script ? The script is just hidden children "cannon", the breeding ground for the second prototype TLF type above (so you work a gun), and produce a vehicle roof firefighters All this really is not too difficult to Iraq Momin white that.

 

You mean, if made in accordance with the instructions provided by you, it can take two water cannon can shoot water out of this? !

Link to comment
Share on other sites

Nope. A water cannon added as a child can't do anything. Childs are always there for eye-candy. Only a cannan added as superstructure to a TLF vehicle can work. That's why the child will be hidden when the command is activated and replaced by the TLF gun.

Link to comment
Share on other sites

Did you actually try to look how the vehicles are set up in the limited water demo mod? Too be honest, you do not provide much information, so we keep running around in circles providing you the basic information only. If you just compare the prototypes in the limited water demo mod with yours I'm sure you can figer it out.

Summarized, this is how you're supposed to set up the vehicle and get it to work with the Waterswitch.script (to spawn a custom water cannon on a GTF vehicletype).

1. GTF vehicletype with a maximum of 4 hose connections added as superstructures (which is the default setup of a regular GTF)

2. Add two childs, the first child is a deck gun model and named "cannon". The second child is only used to define the position of the fireman on the roof who is controlling the deck gun. Hence the name of that child is "controller". You can use any object for that.

3. Add 'VcmdCannonSwitch' to the vehicle too

4. Also, make a second vehicle prototype (TLF type) with an invisible model and the cannon added as a superstructure on the same position as the child in step 2. So, in the editor, the only thing you see is a floating water cannon.

If you have no idea what I mean, take a look at the prototypes in the limited water mod. It's really simple.

So how does the script work with all this? The script simply hides the child "cannon", spawns the second TLF type of top of the prototype (so you have a cannon that works) and spawns a fireman on the roof of the vehicle too.

That's all, it really aint too hard to understand this imo.

 

Thank for you big help but still... (script are added to the vehicle)

 

GTF Vehicle:

Em42014-04-0818-47-03-05_zps3ee897c3.jpg

Em42014-04-0818-46-57-95_zpse8c2b102.jpg

Em42014-04-0818-47-10-54_zps4974ccee.jpg

 

TLF "Vehicle":

 

Em42014-04-1020-01-35-81_zps8d561d81.jpg

Em42014-04-1020-01-31-26_zpsde0ea624.jpg

 

 

Cannonswith.script:

 

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

// Water cannon script for US Army mod by Hoppah

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

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

object VcmdCannonSwitch : CommandScript

{

VcmdCannonSwitch()

{

SetIcon("wateroff");

SetCursor("wateroff");

SetGroupLeader(true);

SetGroupID(31);

SetValidTargets(ACTOR_VEHICLE);

SetRestrictions(RESTRICT_SELFEXECUTE);

}

bool CheckPossible(GameObject *Caller)

{

if (!Caller->IsValid())

return false;

if (Caller->GetType() == ACTOR_VEHICLE)

{

Vehicle v(Caller);

if (!v.HasCommand("Extinguish") && !v.HasCommand("Cool") && v.GetNumPassengers() == 0)

return false;

if (!v.HasCommand("Extinguish") && !v.HasCommand("Cool") && v.HasCommand("DummyEmptyTank"))

return false;

if (v.HasCommand("Extinguish") && v.HasCommand("Cool"))

{

SetIcon("wateroff");

SetCursor("wateroff");

SetPriority(65);

} else

{

SetIcon("wateron");

SetCursor("wateron");

}

}

return true;

}

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)

{

if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID())

return false;

if (Caller->GetType() == ACTOR_VEHICLE && !Caller->HasCommand("DummyEmptyTank"))

return true;

return true;

}

void PushActions(GameObject *Caller, Actor *Target, int ChildID)

{

Vehicle v(Caller);

if (!v.HasCommand("Extinguish") && !v.HasCommand("Cool") && !v.IsCurrentAnimation("activate"))

{

v.AssignCommand("Extinguish");

v.AssignCommand("Cool");

v.SetChildEnabled("cannon", false);

v.SetAnimation("activate");

float r[9];

v.GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);

Vector PosChild = v.GetChildPosition("controller");

PersonList l = v.GetPassengers();

Person p = l.GetPerson(0);

v.RemovePassenger(&p);

if (p.IsEquipped()) p.SetEquipment(EQUIP_NONE);

p.AssignCommand("VcmdCannonSwitch");

p.SetUserData(v.GetID());

p.SetCommandable(false);

p.SetSelectable(false);

p.SetPlacement(PLACEMENT_NONE);

p.SetPosition(PosChild);

p.SetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);

Vector Pos = v.GetPosition();

if (StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/02 LA Fire Department/fire_engine1.e4p") == 0)

{

p.PushActionRotateTarget(ACTION_NEWLIST, &p, 0, 180, 0, 0.01f);

p.PushActionSwitchAnim(ACTION_APPEND, "idleheavyobj");

Vehicle cannon01 = Game::CreateVehicle("mod:Prototypes/Vehicles/02 LA Fire Department/mpcannon.e4p", "local_cannon");

cannon01.SetPlacement(PLACEMENT_NONE);

cannon01.SetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);

cannon01.SetPosition(Pos);

cannon01.UpdatePlacement();

cannon01.SetPlayerMP(v.GetPlayerMP());

cannon01.SetCommandable(false);

cannon01.SetUserData(v.GetID());

cannon01.EnableAutoTarget(true);

}

else if (StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/01 US Army Camo/tfft.e4p") == 0)

{

v.EnableTrafficLight(TLT_GREEN);

v.PlayAnimOpenDoor(DAT_SPECIAL, 1.5f, Caller);

p.PushActionSwitchAnim(ACTION_NEWLIST, "idle");

Vehicle cannon01 = Game::CreateVehicle("mod:Prototypes/Vehicles/04 Objects/tfft_cannon01.e4p", "tfft_cannon01");

Vehicle cannon02 = Game::CreateVehicle("mod:Prototypes/Vehicles/04 Objects/tfft_cannon02.e4p", "tfft_cannon02");

cannon01.SetPlacement(PLACEMENT_NONE);

cannon02.SetPlacement(PLACEMENT_NONE);

cannon01.SetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);

cannon02.SetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);

cannon01.SetPosition(Pos);

cannon02.SetPosition(Pos);

cannon01.UpdatePlacement();

cannon02.UpdatePlacement();

cannon01.SetPlayerMP(v.GetPlayerMP());

cannon02.SetPlayerMP(v.GetPlayerMP());

cannon01.SetCommandable(false);

cannon02.SetCommandable(false);

cannon01.SetUserData(v.GetID());

cannon02.SetUserData(v.GetID());

cannon01.EnableAutoTarget(true);

cannon02.EnableAutoTarget(true);

}

}

else if (v.IsCurrentAnimation("activate"))

{

if (!v.IsSmoking() && !v.IsDestroyed() && v.IsValid())

{

v.RemoveCommand("Extinguish");

v.RemoveCommand("Cool");

}

v.SetChildEnabled("cannon", true);

v.SetAnimation("deactivate");

int UnitID = v.GetID();

PersonList l(ROLE_SQUAD);

for(int i = 0; i < l.GetNumPersons(); i++)

{

if (l.GetPerson(i)->GetUserData() == UnitID && l.GetPerson(i)->HasCommand("VcmdCannonSwitch"))

{

Person p = l.GetPerson(i);

p.SetPlacement(PLACEMENT_CUSTOM_PLACEMENT);

p.RemoveCommand("VcmdCannonSwitch");

p.SetCommandable(true);

p.SetSelectable(true);

if (!p.IsInjured() && !p.IsDead())

p.PushActionSwitchAnim(ACTION_APPEND, "idle");

if (p.IsInjured() || p.IsDead() || v.GetFreePassengers() == 0 || v.IsSmoking() || v.IsDestroyed() || !v.IsValid())

{

Vector pos = v.GetPosition();

Game::FindFreePosition(&p, pos, 250.f);

p.SetPosition(pos);

} else

v.AddPassenger(&p);

}

}

GameObjectList l2;

if (StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/02 LA Fire Department/fire_engine1.e4p") == 0)

l2 = Game::GetGameObjectsWithPrefix("local_cannon");

else if (StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/01 US Army Camo/tfft.e4p") == 0)

{

l2 = Game::GetGameObjectsWithPrefix("tfft_cannon");

v.EnableTrafficLight(TLT_NONE);

v.PlayAnimCloseDoor(DAT_SPECIAL, 1.0f, Caller);

}

for(int i = 0; i < l2.GetNumObjects(); i++)

{

GameObject *obj = l2.GetObject(i);

if (obj->GetUserData() == UnitID)

{

obj->ClearActions();

obj->PushActionDeleteOwner(ACTION_NEWLIST);

}

}

}

}

};

object DummyLimitedWater : CommandScript

{

DummyLimitedWater()

{

SetGroupID(20);

}

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)

{

return true;

}

void PushActions(GameObject *Caller, Actor *Target, int childID)

{

}

};

object DummyEmptyTank : CommandScript

{

DummyEmptyTank()

{

SetGroupID(20);

}

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)

{

return true;

}

void PushActions(GameObject *Caller, Actor *Target, int childID)

{

}

};

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