So guys, since this is working now, and I'll be uploading the script some day soon (hopefully), I'll just get you started on the preparations. (PS. The original post is at the bottom of this one)
This will be divided into the following sections:
1. Placing VO's
2. Parking spot direction on startup.
3. Change script to your liking
4. Create command icons (if needed)
1. Placing VO's
So, when you are trying this, I'm assuming you know your way around the editor, and at least have some knowledge about scripting. This 'tutorial' assumes you use the LA mod as a base, but this can be done on other mods as well.
First of all, you need to add a controlpanel for the police station to your map, which can be placed anywhere. I'd recommend somewhere near the police station of course (Name this control panel 'police_station_controlpanel'.
Starting with the VO's. In the script as it is, created for my personal liking, it is set up like this:
- 4 parking spots behind the police station. These spots are reserved for a specific vehicle type, not every car can park there. I set them up for 1 SUV, 1 van, and 2 CHP dodge chargers.
- 2 parking spots at the donut place near the police station (were already there). These are reserved for a LAPD patrol car.
- All cars spawn at the beginning of the game
- All personnel spawns at the beginning of the game and runs to their cars
Let's call the vehicles stated above "special" vehicles from now on, since they have their own parking spot.
The 3 parking spots in front of the police station are drop-off points. All vehicles carrying transports (criminals or civilians placed into police cars) will drive to one of these 3 parking spots in front of the police stations first. There they will release the criminals, which will walk into the police station as usual.
From here on, the special vehicles will drive to their own personal parking space. If those parking spaces are already filled by other vehicles, or if the vehicle is not special, it will start a patrol after dropping off the prisoners.
Parking spots
Now, as you can see, this means I added 4 new parking VO's. These can be placed by you anywhere you like. Be aware: The size of the VO doesn't determine where the vehicle parks, or what kind of vehicle will fit into it. the vehicle will always place its own center point over the center point of the VO.
After you placed the parking spots (you can decide to have more or less, the addition or removal is easy in the script.), you have to place a "turnto" VO in front of it. This decides what direction the parked vehicle will turn to when it has parked. It also is the first spot the vehicles drives to. (Drive to turnto VO > Turn to parking spot > Drive to parking spot > Turn to turnto VO). The easiest way to do this is to clone the parking spot itself and placing it in front of the parking spot.
Be sure to name these VO's properly, and write them down somewhere. It'd recommend something like "ps_park01" and some one. (PS being Police Station)
Spawn points
If you want your personnel to spawn at the beginning of the game, you need to create new spawn VO's for that.
Add a spawn VO and a "moveto" VO near every cluster of vehicles you have (so one for the cars at the donut shop, and one for the cars behind the PS, if you're doing the same as me).
Squads
To tell the game where the personnel for every vehicle should spawn (since you have multiple spawn VO's), you have to make another VO that completely covers the parking spot VO's. Be careful not to cover the "turnto" VO's with the squad VO, this could cause problems.
2. Parking spot direction on startup.
For some reason, determining the direction your cars are pointed towards on startup is a bit different from when they return to base. Your cars can only be placed pointing in the same direction as another object on the map. Now this is usually a gate from the firestation (on the LA mod map). These are placed in all directions: North, south, east and west. (Front FS1, Back FS1, Front FS2, Back FS2 if I'm correct).
If any of these gates does not match the direction you want your car to be pointing towards, you can add a object to the map that points in the right direction. I used a trashcan to direct the two units at the donut shop.
This is a bit of trial and error, because you don't know what the front of an object is, so just try placing the object and check which way the cars point, then you've got your front side of the object..
3. Changing the script to your liking
Start by deciding how many parking spots you want, where you want them, and above all: what cars should park in which spots.
Go to "...\Emergency 4\Mods\Los Angeles Mod v2.1\Prototypes\Vehicles\03 LA Police" and find the prototype files of the cars you wish to use as your "special" cars.
In example: the CHP Dodge Charger's model is called "dodge_charger_chp.e4p". If you are unsure which model file you need, you can check in the editor.
Be sure to write all these down somewhere (in a .txt file would do).
Next the personnel.
Go to "...\Emergency 4\Mods\Los Angeles Mod v2.1\Prototypes\Persons\03 LA Police" and find the prototype files of the personnel you wish to spawn from the police station for your cars.
In example: the CHP Officer's model is called "chp_officer.e4p". Again, this can be found in the editor if you're not sure.
Write these down as well.
4. Create command icons
Now this is an optional bit. It's quite a bit work to get it done. It does look better, but it is not necessary for the game to work.
You would need a headshot of every unit you want a spawn button for on the control panel. (you can also just create a bit of white text in paint or photoshop if you want).
Aftert that, use this tool to create the command icon.
Place the resulting DDS files in "...\Emergency 4\Mods\Los Angeles Mod v2.1\Ui\Game\Icons\Commands" and make sure you name them properly. The tool will name them automatically. If your base file is called "unnamed", the output will be "unnamed_disabled", "unnamed_mouseover" and so on. The easiest way is to change the name of your base file into whatever unit you are using. So if it's a headshot of an officer, call the basefile "officer.jpg" (or any other supported file extention).
(This only can be done when you've got the script I'll provide) Go to the script file that includes the spawning command for that specific unit, and look for this bit:
object VcmdCallEMT : CommandScript { VcmdCallEMT() { SetCursor("alarm"); SetIcon("callemt"); }
If you've got your script ready, the 'VcmdCallEMT' bit should already be named for the unit you want, so in this case: "VcmdCallOfficer".
After that, change the SetIcon parameter to "officer". This should automatically use the right icon.
Recap
So, the things you should have done by now:
- You placed an extra control panel
- You placed all VO's for your new vehicles: Park VO's, turnto VO's, spawn VO's and squad VO's.
- You determined which cars you want to be "special" and have written all their file names down.
- You did the same for the personnel that should occupy these vehicles.
- You made sure all your parking spots face in the same direction as the firestation gates, or you added an extra object that does point in the right direction.
- (optional) You've created the command icons for all personnel you want to be able to spawn by clicking on a control panel.
- (optional) You got excited because you can almost use this script
Original post:
Dieser Beitrag wurde von Tim Derks bearbeitet: 29 August 2014 - 02:03