Jump to content

Hoppah

Members
  • Posts

    7,379
  • Joined

  • Last visited

  • Days Won

    292

Everything posted by Hoppah

  1. Make sure the objects that can be picked up have a flag set that's called 'RECOVERABLE'. That seems to be the only restriction for objects that are no vehicles. The rubble probably only has the flag set 'PULLABLE', so you may want to change that for either the object in the editor, or change the script so the heli can also pick up objects with the flag set 'PULLABLE'.
  2. As for the brush truck, yes you will have to set the max to 1 in the script, just like it's kinda done in the older rapid deployment script. Does the limited water at least work for the hose connections? Can you post your edited scripts here? I'll take a quick look.
  3. Yes, I can kind if I want to. 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, 1That'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.
  4. New vehicles, new events and the water supply logic. Those will be the major additions.
  5. The download page has a link to the 0.5 update.
  6. Correct, as for the water cannon, you also need an entirely invisible TLF vehicle with the water cannon superchild. That's the proto that spawns over the engine. Check out the folder Prototypes/Vehicles/06 Objects/ for the demo mod's example.
  7. //******************************************************************************************// #Version 1.6#// Script by Dyson - Use in other mods is permited but credit is required////******************************************************************************************int DummyGroup = 20;const char NAME_WATERCON[] = "hose_connection";const char NAME_HYDRANT[] = "hydrant";const char CMD_DUMMYATTACHFH[] = "DummyAttachFirehose";const char CMD_REMOVEFH[] = "RemoveFirehose";const char DUMMY_CHANGE[] = "DummyChange";const char AUDIO_HOSE[] = "mod:Audio/FX/equipment/hosecoupling.wav";const char PROTO_UFL[] = "mod:Prototypes/Objects/Equipment/firehose02.e4p";const char PROTO_SROHR[] = "mod:Prototypes/Objects/Street/hydrant01.e4p"; object AttachFHVehicle : CommandScript{AttachFHVehicle(){SetValidTargets(ACTOR_OBJECT | ACTOR_VEHICLE);SetPossibleCallers(ACTOR_PERSON);SetPossibleEquipment(EQUIP_FIREHOSE);SetIcon("AttachFireHose");SetCursor("AttachFireHose");SetPriority(120);} bool CheckTarget(GameObject *Caller, Actor *Target, int childID){if(!Caller->IsValid() || !Target->IsValid() || (Caller->GetID()==Target->GetID()))return false; Person c(Caller);if (c.GetEnteredCarID() != -1)return false; if(Target->GetType() != ACTOR_VEHICLE) return false; Vehicle v(Target); if(v.HasCommand(DUMMY_CHANGE)) return false; if(v.GetEnergy() > 0.1f * v.GetMaxEnergy() && v.HasChild(NAME_WATERCON))return true; return false;} void PushActions(GameObject *Caller, Actor *Target, int childID){ Vehicle v(Target); Caller->PushActionMove(ACTION_NEWLIST, v.GetChildPosition(NAME_WATERCON)); Caller->PushActionExecuteCommand(ACTION_APPEND, CMD_DUMMYATTACHFH, Target, 2, false);}}; object DummyAttachFirehose : CommandScript{DummyAttachFirehose(){ SetGroupID(DummyGroup);} bool CheckTarget(GameObject *Caller, Actor *Target, int childID){} void PushActions(GameObject *Caller, Actor *Target, int childID){ Person p(Caller); switch(childID) { case 1 : { char wstring[5]; snprintf(wstring, 5, "%s", Target->GetName()); if(wstring[0]!='v' || wstring[1]!='e' || wstring[2]!='r' || wstring[3]!='t') { p.RemoveObjectInRightHand(); if(Target->GetType() == ACTOR_OBJECT || Target->HasName(NAME_HYDRANT)) p.AssignCommand("AttachFHVehicle"); p.EnableAutoTarget(false); } else { p.PlaceObjectInRightHand("mod:Models/Objects/Equipment/firehose02.v3o"); p.EnableAutoTarget(true); } } break; case 2 : { Vehicle v(Target); if(p.GetBoundingRadiusDistXYToObject(&v) > 50.f) { Game::ShowHelpTextWindow("Vehicle too far away!"); return; } float r[9]; v.GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); p.SetPosition(v.GetChildPosition(NAME_WATERCON)); p.SetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); p.SetAnimation("none"); p.EnableAutoTarget(false);//p.Deselect();p.SetFlag(OF_HIDDEN);//p.SetCommandable(true);Audio::PlaySample3D(AUDIO_HOSE, v.GetChildPosition(NAME_WATERCON));p.SetResistance(INJUREREASON_UNKNOWN, 100000.0f);p.SetResistance(INJUREREASON_CONTAM_ATOM, 100000.0f);p.SetResistance(INJUREREASON_CONTAM_CHEM, 100000.0f);p.SetResistance(INJUREREASON_CONTAM_BIO, 100000.0f);p.SetUserData(v.GetID());Person n = Game::CreatePerson(p.GetPrototypeFileName(), Caller->GetName());p.GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);Vector PerPos = p.GetPosition();if (n.IsValid()){Game::FindFreePosition(&n, PerPos, 100.f);n.SetPosition(PerPos);//n.SetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);n.SetPlayerMP(p.GetPlayerMP());n.SetHealth(p.GetHealth());n.SetUpgradeLevel(3);if(p.IsSelected()){ n.Select(); p.Deselect(); } char wstring[6]; snprintf(wstring, 6, "%s", v.GetName()); wstring[0] = '0'; int vID = atoi(wstring); char nstring[9]; snprintf(nstring, 9, "vert%i", vID); GameObjectList list = Game::GetGameObjects(nstring); for(int i = 0; i < list.GetNumObjects(); i++) { list.GetObject(i)->AssignCommand(CMD_DUMMYATTACHFH); }}Game::ShowHelpTextWindow("Engine Hooked Up to Hydrant"); } break; case 3 : { Vehicle v(Target); Person p(Caller); float r[9]; p.GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); GameObjectList list = p.GetObjectsInRange(400.0f, ACTOR_PERSON); for(int i = 0; i < list.GetNumObjects(); i++) { Person n = list.GetObject(i); if (n.GetUserData() == v.GetID()){n.ClearFlag(OF_HIDDEN);n.PushActionSwitchAnim(ACTION_NEWLIST, "idle");if (p.IsSelected())n.Select();n.SetUserData(0);if(StrCompare(n.GetPrototypeFileName(), p.GetPrototypeFileName())!=0){ n.ChangeModel(p.GetModelFileName()); n.AssignCommand(DUMMY_CHANGE); }n.SetResistance(INJUREREASON_UNKNOWN, 0.0f);n.SetResistance(INJUREREASON_CONTAM_ATOM, 0.0f);n.SetResistance(INJUREREASON_CONTAM_CHEM, 0.0f);n.SetResistance(INJUREREASON_CONTAM_BIO, 0.0f);n.SetPosition(p.GetPosition());n.SetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);p.PushActionDeleteOwner(ACTION_NEWLIST);n.PushActionExecuteCommand(ACTION_APPEND, CMD_REMOVEFH, &n, 0, false);char wstring[6]; snprintf(wstring, 6, "%s", v.GetName()); wstring[0] = '0'; int vID = atoi(wstring); char nstring[9]; snprintf(nstring, 9, "vert%i", vID); GameObjectList list = Game::GetGameObjects(nstring); for(int i = 0; i < list.GetNumObjects(); i++) { Vehicle vert = list.GetObject(i); vert.RemoveCommand(CMD_DUMMYATTACHFH); if(vert.GetNumUsedConnectors()>1) { Game::ShowHelpTextWindow("Water Supply Needed"); /*GameObjectList list2 = vert.GetObjectsInRange(3000.0f, ACTOR_PERSON); for(int a = 0; a < list2.GetNumObjects(); a++) { Person ff = list2.GetObject(i); GameObject hydrant = ff.GetHydrant(); if(hydrant.GetID() == vert.GetID()); ff.PushActionExecuteCommand(ACTION_NEWLIST, CMD_REMOVEFH, &ff, 0, false); } */ } } } } } break; case 4 : { Vehicle v(Target); if(v.GetNumUsedConnectors()>0 && !v.HasCommand(CMD_DUMMYATTACHFH) && !v.HasName(NAME_SROHR)) Game::ShowHelpTextWindow("Water Supply Needed"); else { Caller->PushActionCheckFreeConnector(ACTION_APPEND, Target); Caller->PushActionUseEquipment(ACTION_APPEND, Target, childID, 1.0f); Caller->PushActionExecuteCommand(ACTION_APPEND, CMD_DUMMYATTACHFH, Target, 1, false); } } break; case 5 : { Vehicle v(Target); if(v.GetNumUsedConnectors()==0) { Caller->PushActionCheckFreeConnector(ACTION_APPEND, Target); Caller->PushActionUseEquipment(ACTION_APPEND, Target, childID, 1.0f); p.PlaceObjectInRightHand("mod:Models/Objects/Equipment/firehose02.v3o"); } } break; case 6 : { GameObject g(Target); float r[9]; g.GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); System::Log("wFreeplayLog: Placing Standrohr"); Vehicle s = Game::CreateVehicle(PROTO_SROHR, NAME_SROHR); if (s.IsValid()){ s.SetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); s.SetPosition(Target->GetPosition()); }int PlayerID = Caller->GetPlayerMP();s.SetPlayerMP(PlayerID);Caller->PushActionUseEquipment(ACTION_APPEND, &s, childID, 1.0f); Caller->PushActionExecuteCommand(ACTION_APPEND, CMD_DUMMYATTACHFH, &s, 1, false); } break; }}}; I believe he took it the majority from another modification, but oh well, what's your point of posting this? If I'm not mistaken, this script has a command to attach a supply line to a vehicle, while in my demo mod this feature is entirely incorporated in and merged with the 'attach hose' script.
  8. 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: Make me beautiful tanker, I make you beautiful script.
  9. //******************************************************************************************// #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. Use this:
  10. 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.
  11. 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!");};
  12. Was it one of the freeplay scripts that gave the error? Can you post the script here?
  13. 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
  14. 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.
  15. Hmm, I did finish the freeplay part and it doesn't crash on me. Do more people experience this?
  16. ? 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. 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.
  17. @ Axxif, I like the idea to be able to turn off the pump. Thanks I've released v1.1 of the demo mod which includes the entire functionality for freeplay too. Check out the first post for more information. I will write instructions how to implement the freeplay functionality into other mods tomorrow. Hoppah
  18. Within 24 hours definitely, but I rather deliver something bugfree instead of rushing this.
  19. Had to fix a couple of bugs and was having troubles with the DLK (The ladder) and the water cannon on its basket, but it seems to work fine.
  20. Yes, the script runs in the background and automatically recognizes those vehicle types and assignes the limited water supply logic to them. I'm currently making it compatible with DLK types too, because I forget about the basket's water cannon. Why would it be 'unfortunately'? I'm not claiming I'm the first one to do this and I can't really care about it either. Hell, the first post even mentions something about other mod-creators doing a similar logic. I wrote my own scripts so I could alter it to my own wishes (for the US Army Mod and NYC Mod) and so I could release a version to the public without having to deal with possible copyright claims. As far as I know, my script isn't buggy at all and works flawlessly. The only possible issue might be a performance issue when you're dispatching like 20 fire engine's, but I haven't tested that yet. 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. Hoppah
  21. Limited water supply also works in freeplay now. Check out the topic in the 'Modding Related Support' section now!

    1. Show previous comments  3 more
    2. Fred03

      Fred03

      \o/\o/\o/ Please continue to do the impossible.

    3. C.F.D
  22. @ NathanDollinger, Nice try, but that's not gonna work I'm afraid. If you'd execute your command the second time, it will reset the water level back to ETL (1000). The script has to be set up to check the water levels like once per second so it can update and save the water level for each vehicle and thats not very easy to realise. One of the few ways to do that is using a hidden dummy object which keeps track of the vehicles. However, I've got some good news. Got a little bit bored today and did it myself. That means: You can have limited water supply in freeplay too now So shit just got real. Pictures first: Original TLF on the default EM4 freeplay map: Fire Engine with supply line on the EM4 deluxe map: As you can see the vehicles have an extra command (instead of the information panel) which shows the relative water tank level in 100, 80, 60, 40, 20 or 0% by changing the icons. In game, you can click the command and it will inform you of the actual water levels in gallon and the exact relative amount (as shown in the screenshots too). To make the logic as useful as possible for everyone, I decided to use the vehicleclasses (TLF, LPF and GTF) as references for the maximum water tank amounts. That means it should work with ALL vehicles that are either a TLF, LPF or GTF type and that's it. Other than that, the limited water supply works the exact same as in the demo mission, although the logic is implemented differently. I still need to give the freeplay logic a few extra tests and will release the entire functionality tonight or tomorrow. Hoppah
  23. Thanks. Almost got the 'rapid deployment' command to also automatically install and deinstall the supply line. I will release this minor addition soon. Edit 1: You can find the 'rapid deployment' compatibility files in the attachment. Simply unrar the package and move the files to your "\Mods\Limited Water Supply Test Mod\Scripts\Game\Command\" folder and overwrite the older files. This addition does need some extra testing (I got a ton of CTD's before I got it to work), but it should work fine in general. When clicking the 'rapid deployment' command, one of the fire fighters should install the supply line first now, before he attaches his own hose. Same thing for the reversed command basically. Edit 2: Also managed to get the gated wye to work with the limited water functionality. Seems to work fine. I'll re-release the entire demo mod with the new additions in a few days again. Hoppah RapidDeployment.rar
×
×
  • Create New...