Jump to content
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble


  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

About timmiej93

  • Rank
  • Birthday 08/03/1993

Profile Information

  • Gender
  • Location

Recent Profile Visitors

453 profile views
  1. 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.
  2. 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!
  3. 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.
  4. 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
  5. 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.
  6. 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.
  7. 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
  8. 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.
  9. 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.
  10. 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.
  11. 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
  12. Thank you, gonna test that as soon as I've got some other things fixed!
  13. 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?
  14. Can these spawn points be regulated by scripts too, or do they just spawn vehicles randomly? I need to spawn these vehicles on call.
  15. 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
  • Create New...