-
Posts
207 -
Joined
-
Last visited
Content Type
Profiles
Forums
Calendar
Tutorials
Downloads
Gallery
Everything posted by timmiej93
-
After trying Emergency 5 for a bit, with the Wuppertal mod, I still find myself drifting back to playing EM4, even though EM4 is clearly showing its age. Looking at video production and mods, I'd also say that EM4 is still pretty popular amongst modders and players. To me, EM5 just feels slow. The horrible fading from standstill to moving and vice versa takes any speed out of the game, not being able to quickly go back to an emergency scene after you've completed it, the mouse controls being weird (not being able to tilt the camera without holding an additional button, and tilt changing with zoom? Come on). Sure, EM5 has plenty of advantages: It loads about a hundred times faster than EM4, it looks better, fire is way more realistic, and I'm sure it has better modding options, but it still feels limited. Personally, I'd much prefer the next Emergency title to just be a modernization of EM4. Make sure it can use multiple cores, make it 64 bit, make it able to handle wide and ultrawide monitors, and just speed it up in general. I wouldn't even mind if the graphics and UI remained the way they are. If they would make sure that EM4 mods are still compatible, I think they'd sell a copy to pretty much anyone who still plays EM4. Maybe I'm just being nostalgic, or maybe the newer EM titles are just a bit sub-par, or maybe EM4 really just is better. What are your opinions?
-
Alright, I finally got around to doing an experiment, after a lot of irritation. Here's the testing and the results: Calling function: blabla... Caller->PushActionExecuteCommand(ACTION_NEWLIST, "TimTest", NULL, 0, false); Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 19, false); Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 20, false); Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 21, false); Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 22, false); Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 23, false); Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 24, false); } }; object TimTest : CommandScript { TimTest() {} bool CheckPossible() { return true; } bool CheckTarget() { return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { System::Log("childID %i", childID); if (childID != 0) { return; } Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 1, false); Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 2, false); Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 3, false); Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 4, false); Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 5, false); Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 6, false); Caller->PushActionExecuteCommand(ACTION_INSERT, "TimTest", NULL, 7, false); Caller->PushActionExecuteCommand(ACTION_INSERT, "TimTest", NULL, 8, false); Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 9, false); Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 10, false); Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 11, false); Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 12, false); Caller->PushActionExecuteCommand(ACTION_INSERTBEFORELAST, "TimTest", NULL, 13, false); Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 14, false); Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 15, false); Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 16, false); Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 17, false); Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 18, false); } }; Results in log: !childID 0 !childID 8 !childID 7 !childID 19 !childID 20 !childID 21 !childID 22 !childID 23 !childID 24 !childID 1 !childID 2 !childID 3 !childID 4 !childID 5 !childID 6 !childID 9 !childID 10 !childID 11 !childID 13 !childID 12 !childID 14 !childID 15 !childID 16 !childID 17 !childID 18 My conclusions from this test: Any PushAction... that's INSIDE another function called by PushActionExecuteCommand gets executed AFTER EVERYTHING from the calling function has been executed, as demonstrated by the numbers 0 > 19 > 20 > 21 > 22 > 23 > 24 before going to 1. Using ACTION_NEWLIST inside the second function (TimTest in this case) DOES cancel all queued commands from the calling function. For example, for the PushActionExecuteCommand with ChildID 1, if that had ACTION_NEWLIST instead of ACTION_APPEND, ChildID 8, 7, 19, 20, 21, 22, 23 and 24 do NOT print. Using ACTION_INSERT inserts the command IMMEDIATELY after the PushActionExecuteCommand that called the function you're now in. Using ACTION_INSERT again will do the same, thus pushing the previously inserted item down one spot, as demonstrated by ChildID 0 > 8 > 7. Hopefully this can prevent some frustration among scripters. If you have any questions about my testing, feel free to ask.
-
Thanks for the reply. I got to about the same understanding as what you've written up, but like I asked in my initial post: Where does the command get inserted? Is there any logic to that?
-
So let's be honest, the "PushAction..." system used by EM4 isn't great, but it's what we've got, so I'd like to understand it a bit better. I think most scripters know what ACTION_NEWLIST and ACTION_APPEND do. ACTION_INSERTAFTERFIRST, ACTION_INSERTBEFORELAST and ACTION_REPLACEFIRST are self-explanatory, but what does ACTION_INSERT do? Where does the command get inserted? Has anyone ever figured this out?
-
I'm trying to make some changes to the Bieberfelde 2020 mod (for personal use only, just trying to make the mod more to my personal liking), but I'm having issues with getting all 'PushActionXXX' calls to execute properly. This is the code I've got: void PushActions(GameObject *Caller, Actor *Target, int childID) { Vehicle myVehicle(VehicleList(Caller->GetName()).GetVehicle(0)); int myVehicleID = myVehicle.GetID(); PersonList myCrew(myVehicle.GetName()); System::Log("Start loop"); for (int i=myCrew.GetNumPersons()-1; i > -1; i--) { Person *person = myCrew.GetPerson(i); person.PushActionWait(ACTION_NEWLIST, 0.1f); person.PushActionLeaveCar(ACTION_APPEND, &myVehicle); Mission::PlayHint("1"); person.PushActionExecuteCommand(ACTION_APPEND, "GetFirehose", &myVehicle, 0, false); Mission::PlayHint("2"); person.PushActionWait(ACTION_APPEND, 1.0f); person.PushActionExecuteCommand(ACTION_APPEND, "AttachFireHose", Target, 0, false); Mission::PlayHint("3"); person.PushActionWait(ACTION_APPEND, 1.0f); person->PushActionExecuteCommand(ACTION_APPEND, "attachfirehose_wv", &myVehicle, 0, false); Mission::PlayHint("4"); For clarity: I'm trying to have the GruppenFuhrer (squad leader?) give a command for creating a water supply. This is done by clicking on the hydrant (Target) with the GF. It then finds a person from his vehicle that's "available", tells him to grab a hose, connect to the hydrant, and then connect to the vehicle. The person getting out works fine, and so does getting the firehose. However, with the first "AttachFireHose", things get a bit weird. Despite the fact that I'm calling the exact same function that you would if you connect a firehose to the hydrant manually1, whenever I call the function here, the firefighter attaches a hose to the first attachpoint, even if there's already a hose attached to it. When connecting a firehose to the hydrant manually1, the firefighter does select a free attachpoint. Could this have something to do with pointers? As far as I know2, the Target variable in the snippet above is a reference (so not a copy) to the hydrant, so that should be fine? Now, like I said before, "AttachFireHose" is weird, but it works. "attachfirehose_wv" however, doesn't execute at all. I've put some log entries and PlayHints3 in the code, so I can debug it. I've done this in the snippet above, and in all 3 functions that are called in the snippet above. So as expected, when I click a hydrant with the GF, 1, 2, 3 and 4 pop up pretty much instantly, and the FF gets out and grabs a hose. As soon as the FF starts walking towards the hydrant, the number 5 is displayed. However, the number 6 is never displayed, appearing as if the attachfirehose_wv function is never called. I've displayed how numbers 5 and 6 are located inside their respective functions below. // AttachFireHose void PushActions(GameObject *Caller, Actor *Target, int childID) { System::Log("5"); Mission::PlayHint("5"); // Rest of the code for this function } // attachfirehose_wv void PushActions(GameObject *Caller, Actor *Target, int childID) { System::Log("6"); Mission::PlayHint("6"); // Rest of the code for this function } So basically, I'm at a complete loss. If these functions were simple, I'd just copy their code over into the new function (I know, you shouldn't do that, but if it works and the proper way doesn't ), but these functions are pretty large, and call upon other functions as well. Does anyone have any tips or tricks I can try? Any tips regarding speeding up the testing of code would be nice as well, Bieberfelde is a great mod, but having to sit through that loading time just because you mistyped something, or are trying out a different pointer thingy is not that great. Footnotes: 1: Selecting firefighter with hose, clicking hydrant 2: My C++ skills aren't that great, especially with things like pointers etc., that aren't common in other languages 3: System::Log(""); and Mission::PlayHint("");, displaying numbers, so I can trace in which order (if at all) the code executes.
-
That would be HUGE... We can get so much more work done now :3. I remember playing a cards game on my phone when I was modding for EM4, while the game (and mod) was loading, so I could test my changes. Can't wait!
-
[Working!] Policestation that functions like a Fire station
timmiej93 replied to Tim Derks's topic in Alteration Help
One would say: No replies, no trouble. On the other hand, it could mean it's just too complicated or too much work. Let me know what's going on guys, an luck on getting it working? Any nice setups? I'm curious about what you're all doing. -
[Working!] Policestation that functions like a Fire station
timmiej93 replied to Tim Derks's topic in Alteration Help
Well, this is it. There are 4 script files in the zip file: LAFireStation.script LAFireStationStart.script ToPoliceStation.script move.script All 4 are based on the LA Mod. BE WARNED: These script should not be simply copied over to your scripts folder. They are simply examples and guides on how to edit your own scripts. (This goes for the two firestation scripts and the move script). You DO have to copy over the ToPoliceStation script, but first you DO have to edit it. These changes are all explained with comments inside the scripts. Credits go to Hoppah for making the LA Mod and enabling us to continue modding with it. Also much thanks to ItchBoy for helping me out and sending me some examples. Finally, thanks to everyone who replied to my many topics. To conclude it: Thanks for all the support, good luck on editing your scripts, and if you've got any questions: let me know. PS. I'm sorry if the comments are a bit vague, I assumed that whoever tries this does know quite a bit about scripting. Good luck guys! Tutorial.zip -
How to avoid crash on new freeplay map
timmiej93 replied to bama1234's topic in Modding Related Support
Well, the only logical thing would be that LAFireStationStart is causing the crash, since that script is the only one that gets initiated. On the other hand, if you removed the freeplay script, this script wouldn't get initiated either. -
How to avoid crash on new freeplay map
timmiej93 replied to bama1234's topic in Modding Related Support
I can't find how I fixed my error, sorry mate. You didn't change anything in the scripts or something like that? I don't do much with models etc. so mine was definitely caused by a script, that's for sure. -
How to avoid crash on new freeplay map
timmiej93 replied to bama1234's topic in Modding Related Support
Oh boy.. I had that error once too.. I got rid of it, but I'll have to check how I did that.. Let me get back to you guys -
Well I guess I have no choice.. I've created below script to test if the MD array works, but when adding this to a control panel or a vehicle, it causes the game to freeze after a few seconds, without any error. In my eyes this script should work, but maybe one of you sees a flaw in it.
-
Good point. It's a bit of curiosity as well, discovering new scripting methods etc. I'll let you know how the multidimensional array worked out.
-
Yeah I've been thinking about something like that, but look at it like this: You've got 10 parking spaces. 9 are occupied. The chance that last parking spot number gets hit in the random number generation, is about 10%. That would mean the script would run approx 10 times before it can park. I don't know about you, but that sounds like a lot of memory usage to me, especially in EM4. I'm just about to set up a small test with a multidimensional array. Let's see how that works out.
-
Hey guys, I'm trying to come up with a scripting method to have a script park cars randomly on a set number of parking spaces. Now this isn't the hard part. The hard part, is making sure the script understands when a parking space is filled. This is quite easy when there is a set parking order, since you can go down the list. When going random, it gets had. I've been able to think of one way to do it, but it requires ridiculous amount of code: Script out all possible options: Something like: if parking spot 3, 5 and 7 are occupied, park in one of these (with a list of spots 1, 2, 4, 8, 9 and 10 or something). This should be done for every single option then, and that does not appeal to me one bit. Does anyone know a different way to do this? Could it be possible to use an array with two columns, with column 1 being the data you need, and column 2 containing a 0 or a 1, depending if a car is parked on that spot. Tim
-
How do I spawn a civilian vehicle?
timmiej93 replied to timmiej93's topic in Modding Related Support
Thank you, gonna test that as soon as I've got some other things fixed! -
How do I spawn a civilian vehicle?
timmiej93 replied to timmiej93's topic in Modding Related Support
Does this also work when the spawn VO is not on the path? It's like 20 meters from the road. Would they find that themselves? Or would I need a VO to send them to first, like the ambulance patrol command uses? -
How do I spawn a civilian vehicle?
timmiej93 replied to timmiej93's topic in Modding Related Support
Can these spawn points be regulated by scripts too, or do they just spawn vehicles randomly? I need to spawn these vehicles on call. -
Hey guys, Quick question: How do I spawn a civilian vehicle, on a random spot, but not on a road, and make it join normal traffic? Tim
-
Hide Command Icons w/o Affecting Script Function
timmiej93 replied to The Loot's topic in Modding Related Support
Thanks for explaining, this definitely clarifies it! -
What does "&Vehicle" and "TARGET_ANY" mean?
timmiej93 replied to timmiej93's topic in Modding Related Support
I think I get it, but could you explain to me why that's used in below bit of code? p.SetUpgradeLevel(3);Game::FindFreePosition(&p, Spawn, 250);p.SetPosition(Spawn);p.PushActionMove(ACTION_NEWLIST, &v, TARGET_ANY);p.PushActionTurnTo(ACTION_APPEND, &v);p.PushActionEnterCar(ACTION_APPEND, &v);Entire script if you need it: -
What does "&Vehicle" and "TARGET_ANY" mean?
timmiej93 replied to timmiej93's topic in Modding Related Support
Ohh, so that'd be like having a caller in a command execute a dummy, and being able to use the same caller in the dummy? Thanks for the link btw! -
What does "&Vehicle" and "TARGET_ANY" mean?
timmiej93 replied to timmiej93's topic in Modding Related Support
Thank you! Now just gotta figure out what those &'s mean.. Ps. Where did you get this list? -
Hey guys, I've found above statements in the LAFireStation script in the LA mod, but I assume this works for every mod. The statements are used in a dummy and command where the target vehicle is random, namely the dummy that spawns personnel for vehicles that are empty in the firestation, and a command that repairs any damaged vehicles in the fire station (by spawning an engineer and making it repair them). Considering above bit of text, I assume the & thingy is something like a location finder? It finds where the vehicle is so it can send the personnel to the right spot? And the TARGET_ANY thingy, is that something like Actors, Roles and Behaviors? If so, how does it work? If not, how does it work? Hope you can help Tim
-
Well, it cán be done. The only problem is: it needs more scripting then just adding the ChangeClothes script before the EnterVehicle bit. It's not complicated, but you need a few extra VO's, and you'd need to direct the personnel to those VO's first, then make them change clothes, and then make them enter the vehicle. I hope I get my school stuff done in a few hours, then I'll give you a more detailed explanation. -------------- Well crap.. I had a huuuge post set up, with all kinds of scripting, but it was getting too complicated to just post it on here. I was trying to send all personnel to a specific VO and make them change clothes there, which was OK, but making sure they don't go to the same VO was a bit too much for me without being able to test it and having all needed scripts. But if I may ask: You call this vehicle out, so I assume you're at a different location, not at the fire station. Why would you bother for this animation then? You probably wouldn't see it much.