Jump to content

timmiej93

Members
  • Posts

    207
  • Joined

  • Last visited

Everything posted by timmiej93

  1. Well, the outcome would be the same, right? It still gets sent to that point in the script, so it's quite clear L1 is equal to 0, if I'm not mistaking. I'll get back to you with the results of above script. Edit: L1 is equal to 0, L2 is good.
  2. Well, for some reason, as you expected, L1 equals 0. Here's the log bit: ?(_LAToPoliceStationa83eb): Error: Function PlayHint("L1 is equal to 0") is not defined in current scope ?(_LAToPoliceStationa83eb): FILE:mod:/scripts/game/command/LAToPoliceStation.scripta83eb LINE:277?(_LAToPoliceStationa83eb): Possible candidates are...?(_LAToPoliceStationa83eb): filename line:size busy function type and name ?(_LAToPoliceStationa83eb): ?(_LAToPoliceStationa83eb): !!!Dictionary position rewound... ?(_LAToPoliceStationa83eb): !!!Error recovered!!!
  3. That indeed is an option, but it shouldn't be possible for l1 to have a number of actors that is lower then 1. It's the same principle as the ToFireStation script. Here, have a look: Click (bit of code starts at 273).
  4. Ohhh, I totally missed those. I copied over this part of the script, must've missed those. Thanks for showing me!
  5. Hey guys, I'm getting the Too many "}" error on pretty much every } in my script, very weird. Below you'll find the log and then the lines affected. Lines 1727 and 1737 are those where the If statement ends, after "for(int i=0; i < l2.GetNumObjects(); i++)" How can this be fixed? I've checked, but there doesn't seem to be a syntax problem anywhere. ?(_LAFireStation8b7da): Error: Too many '}'?(_LAFireStation8b7da): FILE:mod:/scripts/game/command/LAFireStation.script8b7da LINE:1727?(_LAFireStation8b7da): !!!Dictionary position rewound... ?(_LAFireStation8b7da): !!!Error recovered!!!?(_LAFireStation8b7da): Error: Too many '}'?(_LAFireStation8b7da): FILE:mod:/scripts/game/command/LAFireStation.script8b7da LINE:1727?(_LAFireStation8b7da): !!!Dictionary position rewound... ?(_LAFireStation8b7da): !!!Error recovered!!!?(_LAFireStation8b7da): Error: Too many '}'?(_LAFireStation8b7da): FILE:mod:/scripts/game/command/LAFireStation.script8b7da LINE:1737?(_LAFireStation8b7da): !!!Dictionary position rewound... ?(_LAFireStation8b7da): !!!Error recovered!!! else if(v.IsCollidingWithVirtualObject(VO_SQUAD02_PD)) { ActorList l1 = Game::GetActors(VO_SPAWN_BACK); if(l1.GetNumActors() > 0) { Vector Spawn = l1.GetActor(0)->GetPosition(); } GameObjectList l2 = Game::GetGameObjects(NAME_POLICESTATION); for(int i=0; i < l2.GetNumObjects(); i++) } else if(v.IsCollidingWithVirtualObject(VO_SQUAD03_PD)) { ActorList l1 = Game::GetActors(VO_SPAWN_DONUT); if(l1.GetNumActors() > 0) { Vector Spawn = l1.GetActor(0)->GetPosition(); } GameObjectList l2 = Game::GetGameObjects(NAME_POLICESTATION); for(int i=0; i < l2.GetNumObjects(); i++) }
  6. So, if I understand correctly, you'd remove all the injured people from the MCU in 1 go, but to make it look good, you make the EMT's with stretchers walk back and forth, while switching between showing an injured person on a stretcher or not?
  7. Yeah it makes sense, and scripting wise that would be the easiest by far. The other solution, manually unloading one by one would be awesome aesthetically though.
  8. Thanks for the suggestion loot, but unfortunately the errors only get thrown when I issue commands
  9. Hey guys, I'm getting above error quite frequently, and I'm just not getting it. To me it sounds like the game has trouble assigning a value to the Symbol, because it hasn't been defined. In this case, the error is referring about this part of code: if(l1.GetNumActors() > 0) Vector FirstPoint = l1.GetActor(0)->GetPosition(); if(l2.GetNumActors() > 0) Vector TurnTo = l2.GetActor(0)->GetPosition(); Audio::PlaySample3D(SND_TOSTATION, Caller->GetPosition()); v.PushActionMove(ACTION_NEWLIST, FirstPoint); v.PushActionTurnTo(ACTION_APPEND, TurnTo);The error refers to the line with "v.PushActionMove" bit in it, and says "Symbol FirstPoint is not defined". I really can't understand why, because I found the same bit of code in another script that comes with the mod, and it works fine there. Could anyone explain it to me? Tim
  10. Exactly my idea, just loop it until it reaches 0 transports. Would have to look into it a bit more to get it working though.
  11. Thank god, this takes forever . Especially frustrating for 1 simple syntax error
  12. Hey guys, I'm probably the only person who doesn't know this, but is there a faster method to test your script changes, other than starting the game, loading the mod and loading freeplay (or your mission)? Tim
  13. It's quite a difficult piece of code, since the normal ambulances have 1 injured person, and 1 set of PM's with stretchers. So logically, code would be: Exit PM's + injured, go to spawn, drop off injured, get back in vehicle. For the MCU, they have to pick up and drop off more victims. It probably can be done, but it's not easy. Tim PS. I might start messing around with it to get some scripting experience
  14. Hey guys, just restarting this topic now, seeing if I can get it all together. I'm working on the LAToPoliceStation script right now, since I'm stuck on the other two. In here I'm trying to achieve the following: - 3 parking spaces in front like default, for temporary parking while dropping off criminals (this is for another time) - 4 in the back, 1 for an SUV, 1 for a Van, 2 for a CHP charger. - 2 at the donut shop, default settings. I'm trying to get the 4 spaces in the back to work right now, which has taken a lot of work so far. I've got the script bug free (AFAIK), but for some reason, those 3 specific vehicles refuse to park. When I hit the ToPolicestation button, they just keep on driving to where I sent them (or just remain stationary). They do however turn off sirens, blue lights etc. They refuse to go to their assigned parking spaces, but no errors. It's quite a tricky script, especially since the vehicles should go to the front 3 parking spaces when they have criminals in the back, and just go to the back when they don't. When I have an SUV with criminals in it, and hit ToPolicestation, the criminals get out and start walking to the PS by themselves. Weird behaviour. I've got the script here for those who are interested in having a look. I really appreciate any help I get, I could use it. Tim --------------- I think I narrowed the problem down to the piece of code below that is available in the original script. I'm not sure how I should incorporate this into my own script. This piece of code normally starts when the caller has found a parkingspace. When I just copy it in like this, and change VO_TURNTO to the correct VO, it gives me an error that states "?(_LAToPoliceStationa8378): Error: illegal pointer to class object GetActor(0) 0x0 4" I hope someone can help me. Vector PD = l1.GetActor(0)->GetPosition(); Vector PD2 = l1.GetActor(0)->GetPosition() + Vector(280,-280,0); ActorList l8 = Game::GetActors(VO_TURNTO); Vector TurnTo = l8.GetActor(0)->GetPosition(); Game::FindFreePosition(Caller, PD); Audio::PlaySample3D(SND_TOSTATION, v.GetPosition()); if (!ToDonut) { v.PushActionMove(ACTION_NEWLIST, PD); v.PushActionTurnTo(ACTION_APPEND, TurnTo); } else { v.PushActionMove(ACTION_NEWLIST, PD2); v.PushActionTurnTo(ACTION_APPEND, PD + Vector(320,-320,0)); v.PushActionWait(ACTION_APPEND, 0.5f); v.PushActionMove(ACTION_APPEND, PD); } v.PushActionWait(ACTION_APPEND, 1.5f); v.PushActionExecuteCommand(ACTION_APPEND, CMD_TOPOLICESTATION, Caller, 2, false); PersonList transports = v.GetTransports(); if (!ToDonut && transports.GetNumPersons() > 0) v.PushActionExecuteCommand(ACTION_APPEND, CMD_TOPOLICESTATION, Caller, 1, false);
  15. Thank you sir, you've clarified a lot. I've got many more questions about the script I'm working on, but they don't fit this topic unfortunately. Too bad, because you seem to know a lot about it. Hopefully you'll find my other topics too! Tim
  16. This is indeed the CMD_TOPOLICESTATION command So if I understand correctly, below script should tell the Van to do whatever is stated under ChildID=1 whenever it has transports in it, and when it doesn't, it parks at Donut, right? if(StrCompare(v.GetPrototypeFileName(), OBJ_VAN) == 0){ PersonList transports = v.GetTransports(); if (transports.GetNumPersons() > 0) v.PushActionExecuteCommand(ACTION_APPEND, CMD_TOPOLICESTATION, Caller, 1, false); else { Park at Donut; }}
  17. One little question I'm finding right now: In a script, say it looks like this if(StrCompare(v.GetPrototypeFileName(), OBJ_VAN) == 0) { PersonList transports = v.GetTransports(); if (transports.GetNumPersons() > 0) v.PushActionExecuteCommand(ACTION_APPEND, CMD_TOPOLICESTATION, Caller, 1, false); elseDoes the script "jump" to the ChildID=1 section straight after the line "v.PushActionExecuteCommand(ACTION_APPEND, CMD_TOPOLICESTATION, Caller, 1, false);", or does it finish something first? Tim
  18. Aaah, now it's kinda clear to me, thanks. I'll go messing around with them, see if I can get them to werk and if I really understand them. Tim
  19. As the title states, I'm wondering how the childID's work, specifically in the ToPoliceStation script. I've got a general idea, but I don't know how they work. Tim
  20. I wouldn't know from the top of my head. You could try downloading a mod that has that feature and looking around in its code, or trying to find info here on the forum.
  21. Do you mean the Fire Department button in the left bottom side of your screen in freeplay? Where you can call any FD vehicle you want?
  22. Aha, I see. Well, I know some things about this, but not much. I'll take the LA Mod for example. This contains a script called LAFireStationStart.script. This spawns all vehicles and personnel on starting a freeplay game. This also contains the parameter you stated before, namely: v.EnableBlueLights(false);. The bad news: This has to be done for every unit. The good news, it can be done fast. Just copy over that line, including the very last bit of the line above. Then place your cursor behind the line you want the BlueLights parameter below and hit paste. This should neatly paste the line in between the other lines. Hope this helps.
  23. What are you trying to achieve exactly? You've got me a bit confused. Is this for the default game's freeplay or for a mod?
  24. Hey guys, sorry to respond after my own post, but I'm afraid most people missed the text I added in the previous post. Hopefully this will bring attention to it. Again, sorry to double post. ------------- Alright, so after some asking around, I found out it's not the VO a truck points towards on starting a freeplay game, it just points in the same direction as a stated object. For the fire stations, these are the actual front gates. If you'd turn a gate 90 degrees in the editor, the trucks behind that gate would make the same turn when starting a freeplay game. You can make your own directional units when no FS gates are pointed in the right direction. My tips: First, take a FS gate and check which side is the front. When you know what's the front, look in what direction it points after you selected it from the objects thingy. Now you know what is "north". All objects you want to place in game will have their own "front side" pointing in that direction. So you can place a dumpster i.e., which will point it's front side in the same direction as your gate did. Turn the front side of this dumpster in the direction you want your vehicles to point in. Don't forget to name the dumpster, something like "turnto_dumpster". Then go to your LAFSStart script and look for these lines: (don't forget to add the const char line at the top, and name the const char NAME_GATE<number><number><letter>) GameObjectList gate01a = Game::GetGameObjects(NAME_GATE01A); for(int i=0; i < gate01a.GetNumObjects(); i++) GameObject *gate1 = gate01a.GetObject(i); GameObjectList gate02a = Game::GetGameObjects(NAME_GATE02A); for(int i=0; i < gate02a.GetNumObjects(); i++) GameObject *gate2 = gate02a.GetObject(i); GameObjectList gate03a = Game::GetGameObjects(NAME_GATE03A); for(int i=0; i < gate03a.GetNumObjects(); i++) GameObject *gate3 = gate03a.GetObject(i); GameObjectList gate04a = Game::GetGameObjects(NAME_GATE04A); for(int i=0; i < gate04a.GetNumObjects(); i++) GameObject *gate4 = gate04a.GetObject(i); GameObjectList gate05a = Game::GetGameObjects(NAME_GATE05A); for(int i=0; i < gate05a.GetNumObjects(); i++) GameObject *gate5 = gate05a.GetObject(i); GameObjectList gate06a = Game::GetGameObjects(NAME_GATE06A); for(int i=0; i < gate06a.GetNumObjects(); i++) GameObject *gate6 = gate06a.GetObject(i); GameObjectList gate07a = Game::GetGameObjects(NAME_GATE07A); for(int i=0; i < gate07a.GetNumObjects(); i++) GameObject *gate7 = gate07a.GetObject(i); GameObjectList gate08a = Game::GetGameObjects(NAME_GATE08A); for(int i=0; i < gate08a.GetNumObjects(); i++) GameObject *gate8 = gate08a.GetObject(i);Copy over one of those lines and change it to fit your needs, like this: GameObjectList gate<number><number><(small)letter> = Game::GetGameObjects(NAME_GATE<number><number><(capital)letter>); for(int i=0; i < gate<number><number><(small)letter>.GetNumObjects(); i++) GameObject *gate<number><letter> = gate<number><number><(small)letter>.GetObject(i); You should keep the numbers and letter the same in the red and blue part. The orange part is the part you'll actually use. To keep this clear, use the same number(s) and letter as before, but don't use the first zero. So gate01a becomes gate1a. This is used as seen in the bit of code below. Hope this helps people. ActorList l7 = Game::GetActors(VO_AMBULANCE01); for(int i=0; i < l7.GetNumActors(); i++) { Vector Ambulance01 = l7.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_AMBULANCE02, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Ambulance01); [color=#ffa500]m.SetRotation(gate1a);[/color] m.UpdatePlacement(); m.SetMaxPassengers(2); m.SetMaxTransports(1); m.SetSpeed(12.0f); m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false); }
×
×
  • Create New...