Hoppah Posted April 28, 2013 Report Share Posted April 28, 2013 (edited) Hoppah presents the SearcHouse scriptDifficulty: Easy**although scripting knowledge is required when you want to edit the random outcomes in the script.The modding concepts thread brought up the idea of searching non-open buildings and have a random outcome such as an injured civilian or an injured fire fighter. I liked the idea (for the US Army Modification) and started working on it and I'd like to share the result.What does the script do? It's a very simple script actually. I've incorporated the entire functionality in the EnterHouse script and there's no need to add new commands to your units Your units can only enter buildings where a child with the name "SearchHouse is present (see instructions). Just like the original EnterHouse.script you only have to click a (non-open-house type) building and your unit will approach the door and disappear for 30 seconds (time can be changed in the script). A fence will spawn in front of the building to remind you the building is being searched. After 30 seconds your unit will appear again, the fence will be deleted and a random outcome will be generated. The provided script has the following random outcomes (SearchHouse_v2: only for buildings on fire or burned down):30% chance that nothing has been found20% chance that a resident has been found and evacuated (will spawn a single civilian near the door)20% chance that your unit will get minor injuries (he will lose 90% of his health when the building is burning, otherwise 45% of his health)10% chance that your unit will get severly injured (he will be laying on the floor in front of the building)20% chance a victim has been found, the unit will spawn while carrying a victim.Each outcome will be described by a short message ingame.How to install:1. Download the attached package. Unrar and copy EnterHouse.script to your "[MOD]\Scripts\Game\Command\" folder.2. Only buildings with a child carrying the name "SearchHouse" can be entered. Check out the instructions in the provided screenshot below to find out how to add childs to buildings.3. Make sure the child is enabled on the buildings on your map. Test EACH building ingame at least once.This screenshot is also present in the provided package.Known bugs/problems:I haven't found any bugs, but for unknown reasons the game might crash without error when the unit is about to enter the building. That error is related to the prototype file of the building (I had it happen with deserthouse01.e4p and deserthouse01b_2.e4p). Solution: Recreate the entire prototype file of the building. Other than that, units might get stuck when they appear again, but this is unlikely to happen. A solution for that would've been the code: 'Game::FindFreePosition', but for some reason that code also crashes the game, so the code has been left out.Script usage:Everyone is allowed to use AND edit the script for personal use or a public mod at your own risk.Versions:SearchHouse.rar: Orginal version which has been tested.SearchHouse_v2.rar: Added disctinction between buildings on fire and normal buildings. Only buildings on fire or burned down might injure a unit or generate a victim, normal buildings won't. NOT TESTED BY MEFeedback on this script will be appreciated!HoppahSearchHouse.rarSearchHouse_v2.rar Edited April 29, 2013 by Hoppah Spelling mistakes, sorry for my English Quote Link to comment Share on other sites More sharing options...
Dyson Posted April 28, 2013 Report Share Posted April 28, 2013 Yes! You made it! Thanks hoppah, I knew it was a sweet idea! Quote Link to comment Share on other sites More sharing options...
Hoppah Posted April 28, 2013 Author Report Share Posted April 28, 2013 Yes! You made it! Thanks hoppah, I knew it was a sweet idea!You're welcome. Quote Link to comment Share on other sites More sharing options...
n00bingtarget Posted April 28, 2013 Report Share Posted April 28, 2013 When I grow up I wanna be like HOPPAH! (Dang, too late, too old now. Does young at heart count?) Man you have such AWESOME SKILLS! Thanks Hoppah! Quote Link to comment Share on other sites More sharing options...
rafaelmfernandez Posted April 28, 2013 Report Share Posted April 28, 2013 ILOVEYOU Quote Link to comment Share on other sites More sharing options...
The Loot Posted April 28, 2013 Report Share Posted April 28, 2013 Awesome! That makes the future of Manhattan Mod more exciting, plus it'll give me more to do in other mods! Quote Link to comment Share on other sites More sharing options...
Handsup! Posted April 28, 2013 Report Share Posted April 28, 2013 Awesome idea! Quote Link to comment Share on other sites More sharing options...
mariuswww Posted April 28, 2013 Report Share Posted April 28, 2013 Like Hoppah himself would say: JIZZZ Quote Link to comment Share on other sites More sharing options...
Dyson Posted April 28, 2013 Report Share Posted April 28, 2013 Awesome work Hops, here's some feedback:I had no crashing issues, it was also straight forward to set up.However things I'd recommend -1. Only being able to enter one person at a time kinda sucks, but if it is the only way I'll make do2. FFs can enter buildings not on fire, which means they can get injured from entering normal buildings, but again if its no other way round it then it'll do. But if it's possible to set the target as must be on fire it'd be far more effective, excellent work!x Quote Link to comment Share on other sites More sharing options...
Hoppah Posted April 28, 2013 Author Report Share Posted April 28, 2013 You can enter buildings with more FFs, select a group of them and click the building. Once a FF has entered the building you can't send more indeed. I did that on purpose because that might've made the script buggy. I'll rather go for the safe way. As for the second thing: I'll make some changes and release a second version tomorrow. Buildings not on fire, will not injure FF's or create victims. Thanks for the feedback.xWhen I grow up I wanna be like HOPPAH! (Dang, too late, too old now. Does young at heart count?) Man you have such AWESOME SKILLS! Thanks Hoppah!Aww, don't exaggerate now, it's a fairly simple script to add some more fun things. Quote Link to comment Share on other sites More sharing options...
Dyson Posted April 28, 2013 Report Share Posted April 28, 2013 Thanks!!! I'll make some changes and release a second version tomorrow.Awesome man, I think the barrier is a cool idea, but for a firefighting version it'd be better not to have, if that makes sense? But it's soo cool man, involves far more units like ambulances etc x Quote Link to comment Share on other sites More sharing options...
Hoppah Posted April 28, 2013 Author Report Share Posted April 28, 2013 Awesome man, I think the barrier is a cool idea, but for a firefighting version it'd be better not to have, if that makes sense? But it's soo cool man, involves far more units like ambulances etc xWell, if you want to increase the time to 1 or even 2 minutes, the barrier is very useful to find out which buildings are being searched.But if you want to disable the barrier, remove the following 5 lines (do not touch the rest) from the script:GameObject m = Game::CreateObject("mod:Prototypes/Objects/Fences/constrfence03.e4p", "Unnamed");m.SetPosition(Pos);m.SetRotation(Caller);m.PushActionWait(ACTION_NEWLIST, TIME_SEARCH-0.5f);m.PushActionDeleteOwner(ACTION_APPEND); Quote Link to comment Share on other sites More sharing options...
Dyson Posted April 28, 2013 Report Share Posted April 28, 2013 Well, if you want to increase the time to 1 or even 2 minutes, the barrier is very useful to find out which buildings are being searched.But if you want to disable the barrier, remove the following 5 lines (do not touch the rest lol) from the script:GameObject m = Game::CreateObject("mod:Prototypes/Objects/Fences/constrfence03.e4p", "Unnamed");m.SetPosition(Pos);m.SetRotation(Caller);m.PushActionWait(ACTION_NEWLIST, TIME_SEARCH-0.5f);m.PushActionDeleteOwner(ACTION_APPEND);Yeah I figured that's what it was for, well if you manage to enable multiple FFs to enter (as they usually search in teams of a full company) blocking the entrance would be a bit odd haha. But yeah fair enough.I'm continuing to test, trying out multiple possibilities, I did have a crash but it wasnt a CTD so I'm guessing it was related to my pcx Quote Link to comment Share on other sites More sharing options...
Hoppah Posted April 28, 2013 Author Report Share Posted April 28, 2013 (edited) Yeah I figured that's what it was for, well if you manage to enable multiple FFs to enter (as they usually search in teams of a full company) blocking the entrance would be a bit odd haha. But yeah fair enough.I'm continuing to test, trying out multiple possibilities, I did have a crash but it wasnt a CTD so I'm guessing it was related to my pcxThe crash I had with those 2 prototypes wasn't a CTD. The game just froze and the logfile didn't mention anything about a crash, so it just stopped responding. Had to use task manager to stop the em4 process. Thats why I mentioned specifically to test all buildings. edit:Added v2 already. Couldn't wait. See first post. Yippie-Kai-Yayedit 2:In most mods, the enterhouse script has been edited, so fire fighters with a hose can enter open_house buildings. To enable that in my script, find and remove the following codes from the script:if(Caller->GetFirehoseID() > 0)return false;if(person.GetFirehoseID() > 0)return false; Edited April 28, 2013 by Hoppah Quote Link to comment Share on other sites More sharing options...
FranciscoDoCarmo Posted April 29, 2013 Report Share Posted April 29, 2013 Always with great ideias Quote Link to comment Share on other sites More sharing options...
Ghost Graphic Designs Posted April 29, 2013 Report Share Posted April 29, 2013 Gotta love everything you do! Quote Link to comment Share on other sites More sharing options...
met police999 Posted April 29, 2013 Report Share Posted April 29, 2013 would be cool to see it swapped around for Police officers like they find Drugs or unregistered firearms but a great script none the less Quote Link to comment Share on other sites More sharing options...
Hoppah Posted April 30, 2013 Author Report Share Posted April 30, 2013 would be cool to see it swapped around for Police officers like they find Drugs or unregistered firearms but a great script none the lessThere's a ton of different outcomes possible ofcourse. Quote Link to comment Share on other sites More sharing options...
met police999 Posted April 30, 2013 Report Share Posted April 30, 2013 Oh there's more? Haha I tried to put it in game but i failed so ill just wait for a mod to with it but great work hoppah! Quote Link to comment Share on other sites More sharing options...
CFDDIVE11 Posted May 6, 2013 Report Share Posted May 6, 2013 Is there a video of this being used in game? Quote Link to comment Share on other sites More sharing options...
The Loot Posted August 29, 2013 Report Share Posted August 29, 2013 Pardon my excavating, but how do I stop people on ladder trucks from being able to search? All I managed was a script error with my attempt. Also, I don't know if this was mentioned, but is it possible to have multiple outcomes if you send multiple people in to search? Whenever I did that, only one thing seemed to happen with only one person. Quote Link to comment Share on other sites More sharing options...
scrivs Posted September 19, 2013 Report Share Posted September 19, 2013 How can I integrate this with the previous EnterHouse script that enables firefighters to take hose lines into open houses? Quote Link to comment Share on other sites More sharing options...
mariuswww Posted September 20, 2013 Report Share Posted September 20, 2013 How can I integrate this with the previous EnterHouse script that enables firefighters to take hose lines into open houses?What script enables firefighters to bring hoses into open houses? Im pretty sure its possible by default? Quote Link to comment Share on other sites More sharing options...
Hoppah Posted September 20, 2013 Author Report Share Posted September 20, 2013 What script enables firefighters to bring hoses into open houses? Im pretty sure its possible by default? It's not I believe. Didn't I add this to the current EnterHouse script? Quote Link to comment Share on other sites More sharing options...
The Loot Posted September 20, 2013 Report Share Posted September 20, 2013 It's not I believe.Didn't I add this to the current EnterHouse script?You had a few lines to remove, I remember. Even doing that it hasn't worked for me.Any ideas on my last post? Quote Link to comment Share on other sites More sharing options...