Okay, so I've been hoping to make a vehicle system for my map.
I'm planning on having two vehicles only, a regular car and a Tank. I'm hoping if somebody could direct me to a tutorial.
I hope to make it so that the Tank turret can be controlled by the second player in the vehicle and fired on the move, where the first player drives.
While the car can only be controlled by the first person to enter and others can just sit in it.
If nobody is in the vehicle I'd like it to go into an no-power state where it's immobile and incapable of doing anything except unloading/loading.
The same where it has run out of fuel.
If that is not achievable I'd just like a simple car/vehicle system with fuel, thanks!
For fuel you can use energy, or if you have energy-based abilities on your vehicles emulate it via buff stacks.
The rest should be doable through the Load/Unload Behavior/Effect fields on the Transport ability.
One problem I never found out how to fix is that vehicles seem to apply a permanent and untraceable mind control to cargo units. I'm not sure if effects/buffs can modify the "origin player" of a unit, if they can't you'll need triggers.
For the turret you'll have to elaborate what exactly it should be able to do, right now I can't think of a method that wouldn't allow the driving player to control it too, at least without adding a dummy unit owned by the turret user.
I've got the basic vehicle down, with one slot.
Is there any way to make it so two players can get in and one control it? Or is it only a way both can?
I've made it so that one player unloads, the transport gains the Colonist Vehicle - Parked.
If two people sit in there, wouldn't it apply the behavior if just one got out?
You can add a validator to check if the transport is empty.
Depending on how exactly it's set up the other player either automatically assumes full control or, more likely, has to exit and reenter the vehicle to control it.
You can always add checks to restrict control to the first player to enter the vehicle, though you will have problems if the second player can actively control the turret. If the turret is part of the vehicle you'd have to share control, which also allows move orders, so the turret has to be a dummy unit or integrated into the cargo units (which continue to exist at the center of the transport, they're simply hidden)
I've decided not to do the whole turret thing, now I just want a working vehicles system.
So I've got a bunch of triggers setup, all meant for 1 player per vehicle.
The problem is neutral will not load the units, since I gave all the vehicles to Neutral.
Should I give it to an allied AI? But how would I do that so that it wouldn't give vision?
Please note I am not the greatest editor in the world, ha.
In the ability, target filters allow neutral. So it's not that, right?
Note that simply enabling an AI/driver-controlled turret once a second unit enters the vehicle is extremely simple, even adding 1 turret for each subsequent unit that enters. I'm not sure, but there might be a way of commanding the hidden cargo unit directly, which could be used for a controllable turret.
I'm not sure which flag you have to enable to allow neutral transports to load player units, but can't you start with an empty filter and one-by-one add the restrictions you need? If it doesn't load with an empty filter and no validators something else went wrong or they changed the logic.
Out of curiosity, have you made a working system to allow multiple players to enter the same vehicle? If/once you do, is the original ownership of the unit preserved after unloading? This is what completely halted my first attempt at this, as both transport and cargo unit would switch to Neutral, the original owner of the transport, upon unloading.
I got as far as the Vehicle not working on Neutral controlled, but I'll keep going at in 15 mins or so.
For now I've gotten the Tank model (Courtesy of Rulerian's MW Assets) and Data completed. However I haven't implemented anything Vehicle System related to it.
After all this is over, I'll make a tutorial on a multiplayer vehicle system. Compile my limited knowledge and try to make something of it, ha.
I've managed to make a pure data neutral bunker. I've added rudimentary validators which should prevent the bunker from changing ownership while there are still units inside. Changes in transport ownership also automatically affect all cargo units, so simply recapturing whenever a unit enters is a bad idea.
Note that this version requires the entering unit to have a specific capture ability, for some reason applying the Modify Unit effect directly doesn't work (it works perfectly fine for changing ownership of the cargo unit though); make sure this ability is enabled under all circumstances where a unit can enter the neutral structure or the unit will be stuck forever and break the system (at least with the current validator setup)
Allied units in a player-controlled bunker are also stranded in there if you don't have shared control, but I'm sure I can find a workaround for that if you need it.
For the map I think I've added the same suffix to all custom entries, but they should also be listed under the map data source anyway.
Daleman with his Cops and Robbers maps uses that, but somehow he allows multiple players to control the cars,
but to get into a vehicle it has an ability like that where the unit takes control. Note that players cannot control
other player's heroes.
I've already setup a periodic event, every 0.0 seconds it checks if Mechanical units have Energy.
If not, they are given 1 Colonist Vehicle - Parked behavior.
When the car loads a unit, it is given a On behavior I made, which just drains 0.25 energy a second.
Then via triggers, it removed the parked behavior.
I'll try implementing your ability into the map and see if it works, I'll also try giving control of hostiles.
There's an option for sharing control without vision (it's called Set Alliance Aspect), but why do you need shared control at all? My setup can do without it, and it won't help stuck units get out as the bunker never switches back to neutral.
The "Cops and Robbers" system probably only uses validators to check unit type against a list of allowed vehicles or to disallow use on units with specific attributes. I didn't bother adding these failsafes for my demo map as the ability shouldn't be accessible to players (just remove the command card buttons on the Marine and Bunker and there's no way a player can use it willingly)
If you make the bunker switch allegiance with units still inside all those units will change ownership too, so if you want to do that you have a hard limit of 2 units per transport (then you can target the remaining cargo unit for setting bunker allegiance and it's guaranteed to not rob anyone of their units, using the "reset to neutral" as the fallback option if the bunker is left empty)
You should use data for the fuel, and running anything on a 0.0s period should either lag/crash the game or be hardcoded to stop after 1 execution to prevent the former. A basic setup:
Add a "unmanned" Buff to the transport unit (in the Units data tab), but give it a Deactivate validator "Transport not manned" (type Unit Compare Behavior Count)
Add a "manned" Buff to the Load Transport Behavior field of the Transport ability. The above "Transport not manned" validator should check for this buff (stack count=0)
Make this buff apply negative energy regen or (if the vehicle has a regen delay) a periodic Modify Unit effect to drain energy
Add a Remove validator energy>0 (or 5 or whatever) to signify running out of fuel
Add an Issue Order-Unload All to the Effect-Final field to force the cargo units out if you wish
One thing you could look into for multi-player control is the Interact ability type, used by the Xel'Naga Watchtower. This can be used to share control of a single unit only. The remaining problem is that there's no "partial control" unless you set up an elaborate permissions system via triggers, and you know full well what will happen if you give 4 online players shared control of an armed vehicle (the result depends mostly on the amount of enemies in the vicinity and their relative durability compared to the vehicle)
Edit: Oh, and instead of double posting you should edit your previous post and add to it if it's still the last one in the thread. People rarely use the "quote" function around here so there'll be no problem with butchered quotes.
How would I edit the abilities you gave me to make it only affect Mechanical attribute units?
And how would I make it so that the ability gives it to an allied player who is controlled by all players? (This is what I believe Cops and Robbers does)
It gives it to an allied controllable player then gives it back to an uncontrolled neutral after all units exit.
Thank you for all the help you've given so far, I really appreciate it. SoulCarverR is offering to help me with making the tank system, it would be a very neat system for character/vehicle interaction. Most maps are either really in-depth vehicles with no characters, or mediocre character/vehicle systems.
MassDestruction 2 for instance is really in-depth with vehicles, but you don't get to exit the tank and walk around as a character.
To be honest, I do not have any idea how most of this stuff works. I'm the kind of mapmaker who comes on here and asks for help.
Hopefully I'll be able to make tutorials one day, haha. ^_^
You can set a target filter on the ability, or place validators somewhere in the setup. Note that for the intended structure the target filter would be irrelevant unless you make biological transports using the same Transport ability, which is dumb if you want different rules for those.
Again: the ability isn't meant to be on the command card and thus will never be used by the player themselves. The command card button on the Marine and the redirect button on the Bunker are only dummies I used for testing and didn't bother to remove.
The actual use of the ability occurs through the Transport ability, which includes an Issue Order effect to force the unit to cast the mind control ability. I tried it with applying the mind control effect directly and it didn't work, hence I added the ability.
For the shared control I still suggest you look at the Interact ability, it has a specific flag to share control of the host unit with the "interaction partner". You can also still target units inside the transport through area searches, autocasts, Issue Order effects and Order triggers allowing the "hidden" flag, players themselves can't click them though.
Well, players will be able to build their own Bunkers. So it's not a problem leaving the default one and just making a duplicate for the Vehicles.
I like the way the load/capture changes back to the neutral player when all units leave, that's spot on.
So I'll try and make it so the ability you made changes it to player 5 (I have 4 players on my map).
Then make it auto-cast when you right click on Mechanical Vehicles, in other terms it will be like the Cops and Robbers vehicle system.
EDIT: Got the change to player 15 (hostile), now I just need to make it so that the player's unit doesn't exit controlled by Hostile. How would I do this?
When a transport switches ownership, all cargo units also switch to the same owner. This appears to be hardcoded with no data-only way of disabling it. Giving a unit to any specific player outside of the always-uncontrollable ones (0: Neutral, 15: Hostile) doesn't work through data, you need triggers for that.
As a workaround you could run a 500 range search for a unit only the AI ally may own on your team. The enemy AI ally can be excluded through search filters. Then use this unit to define the new owner. Again, it is important that the transport is empty at the time it switches ownership.
One thing you could try is making the capture ability on the unit a "smart command" (activates on right-click) and adding an Issue Order-Enter Transport to it. In that case you'll need a waterproof validator system to ensure it won't work on any other units. I think a Combine-AND of "target cargo hold empty", "target is neutral" and a whitelist of unit types should do it. (whitelist= Combine-OR of unit type validators)
I'll see if I can make it work, Modify Unit ownership change seems a bit finicky/buggy.
Edit: This should match your requirements. I've added explanations to everything I edited, check the Editor Comment fields. The text message triggers are debugging relics, the alliance triggers are mandatory for this to function. Players 2+6 represent the enemy team, they shouldn't share control with player 1, that's a testing feature.
Edit2: The version you want is now called TeamBunker. I added an Interact ability to the old setup to allow allied units to get out of the bunker, that's NeutralBunker. No comments added to that one though. (yet)
EDIT: This works perfectly except for one thing, it disables Items from being picked up because the unit is given to Player 6 when right clicked. How do I make a validator on it so that it only works on Mechanical units? Other than that, it'll be perfect. I can add the fuel system to it and voila, realistic car system.
EDIT2: Found the Target Filters on the ability, trying it now.
EDIT3: It's working perfectly after I fixed the Filter. Thank you so much for all the help, I could have never done this by myself. As for the tank, I think I'll just leave it so that multiple people can control and shoot from it.
EDIT4: So I forgot that player 6 was a computer player on my map, I implemented the ability and it worked at first. I then fixed the filter, "Perfect" I thought!.
Then a few minutes later when I was renaming and fixing the computer AI in the Player Properties, for some reason it's screwed up now and won't even load the player. I have no idea what I could have done because I have no idea how those abilities work.
And yes, I did try copying the abilities from your map back into mine again... No success. :(
I did set the triggers to ally player 6 to the first 4 players.
The ability took control of an item by right-clicking it? Please check the contents of the Smart Validator on the ability in your map, I included a target filter that should specifically prevent this. (CaptureNeutral TargetList)
The functionality of the setup is not built around the player numbers 5 and 6 specifically. The criteria are as follows:
The AI player must be considered an ally (with shared vision and control) by the casting unit's owner
The AI player shouldn't have any AI scripts that may involve the transport (standard AI, "order all units to attack" etc)
The AI player must be the only ally to own the specified "AllyUnitType" (I used Automaton 2000), this is what marks one particular player on the team. If multiple owners are present one will be picked based on the target sorting system of the Search effect
Shared vision/control can be dropped if you add an Interact ability as in my NeutralBunker map.
"won't even load the player" sounds like you messed up the initialisation trigger or the settings defining the players themselves. This most likely has nothing to do with the transport setup, you don't have to change any of those for it to work.
I simply copied over the abilities and such into my map and made player 6 an ally to all players. I'll see if the triggers on my map are screwing up, if so then it's me.
EDIT: Trying to place an automaton and see if it works now.
EDIT: No it wasn't the automaton, I had added it just now and it still doesn't work.
Note that this is all on my map. Should I just let you check my map file?
When I first copied the stuff over, it worked fine. Until I screwed around with the player properties.
Okay, so I've been hoping to make a vehicle system for my map.
I'm planning on having two vehicles only, a regular car and a Tank. I'm hoping if somebody could direct me to a tutorial.
I hope to make it so that the Tank turret can be controlled by the second player in the vehicle and fired on the move, where the first player drives.
While the car can only be controlled by the first person to enter and others can just sit in it.
If nobody is in the vehicle I'd like it to go into an no-power state where it's immobile and incapable of doing anything except unloading/loading.
The same where it has run out of fuel.
If that is not achievable I'd just like a simple car/vehicle system with fuel, thanks!
For fuel you can use energy, or if you have energy-based abilities on your vehicles emulate it via buff stacks.
The rest should be doable through the Load/Unload Behavior/Effect fields on the Transport ability.
One problem I never found out how to fix is that vehicles seem to apply a permanent and untraceable mind control to cargo units. I'm not sure if effects/buffs can modify the "origin player" of a unit, if they can't you'll need triggers.
For the turret you'll have to elaborate what exactly it should be able to do, right now I can't think of a method that wouldn't allow the driving player to control it too, at least without adding a dummy unit owned by the turret user.
While this tutorial is good, It's missing some stuff.
http://www.sc2mapster.com/forums/resources/tutorials/1164-data-trigger-mount-vehicle-system/
I've got the basic vehicle down, with one slot.
Is there any way to make it so two players can get in and one control it? Or is it only a way both can?
I've made it so that one player unloads, the transport gains the Colonist Vehicle - Parked.
If two people sit in there, wouldn't it apply the behavior if just one got out?
You can add a validator to check if the transport is empty.
Depending on how exactly it's set up the other player either automatically assumes full control or, more likely, has to exit and reenter the vehicle to control it.
You can always add checks to restrict control to the first player to enter the vehicle, though you will have problems if the second player can actively control the turret. If the turret is part of the vehicle you'd have to share control, which also allows move orders, so the turret has to be a dummy unit or integrated into the cargo units (which continue to exist at the center of the transport, they're simply hidden)
I've decided not to do the whole turret thing, now I just want a working vehicles system.
So I've got a bunch of triggers setup, all meant for 1 player per vehicle.
The problem is neutral will not load the units, since I gave all the vehicles to Neutral.
Should I give it to an allied AI? But how would I do that so that it wouldn't give vision?
Please note I am not the greatest editor in the world, ha.
In the ability, target filters allow neutral. So it's not that, right?
Note that simply enabling an AI/driver-controlled turret once a second unit enters the vehicle is extremely simple, even adding 1 turret for each subsequent unit that enters. I'm not sure, but there might be a way of commanding the hidden cargo unit directly, which could be used for a controllable turret.
I'm not sure which flag you have to enable to allow neutral transports to load player units, but can't you start with an empty filter and one-by-one add the restrictions you need? If it doesn't load with an empty filter and no validators something else went wrong or they changed the logic.
Out of curiosity, have you made a working system to allow multiple players to enter the same vehicle? If/once you do, is the original ownership of the unit preserved after unloading? This is what completely halted my first attempt at this, as both transport and cargo unit would switch to Neutral, the original owner of the transport, upon unloading.
I got as far as the Vehicle not working on Neutral controlled, but I'll keep going at in 15 mins or so.
For now I've gotten the Tank model (Courtesy of Rulerian's MW Assets) and Data completed. However I haven't implemented anything Vehicle System related to it.
After all this is over, I'll make a tutorial on a multiplayer vehicle system. Compile my limited knowledge and try to make something of it, ha.
I've managed to make a pure data neutral bunker. I've added rudimentary validators which should prevent the bunker from changing ownership while there are still units inside. Changes in transport ownership also automatically affect all cargo units, so simply recapturing whenever a unit enters is a bad idea.
Note that this version requires the entering unit to have a specific capture ability, for some reason applying the Modify Unit effect directly doesn't work (it works perfectly fine for changing ownership of the cargo unit though); make sure this ability is enabled under all circumstances where a unit can enter the neutral structure or the unit will be stuck forever and break the system (at least with the current validator setup)
Allied units in a player-controlled bunker are also stranded in there if you don't have shared control, but I'm sure I can find a workaround for that if you need it.
For the map I think I've added the same suffix to all custom entries, but they should also be listed under the map data source anyway.
Thank you very much, I'll try it. Was watching Doctor Who for a bit.
Okay, that's a really nice vehicle system.
Daleman with his Cops and Robbers maps uses that, but somehow he allows multiple players to control the cars, but to get into a vehicle it has an ability like that where the unit takes control. Note that players cannot control other player's heroes.
I've already setup a periodic event, every 0.0 seconds it checks if Mechanical units have Energy.
If not, they are given 1 Colonist Vehicle - Parked behavior.
When the car loads a unit, it is given a On behavior I made, which just drains 0.25 energy a second. Then via triggers, it removed the parked behavior.
I'll try implementing your ability into the map and see if it works, I'll also try giving control of hostiles.
If I could simply add the control for multiple players, that'd be perfect. Then I could keep going with the Fuel systems.
I had to look at tutorials and have NO clue how you did that, to be honest. I'm a very inexperienced mapmaker in that way.
There's an option for sharing control without vision (it's called Set Alliance Aspect), but why do you need shared control at all? My setup can do without it, and it won't help stuck units get out as the bunker never switches back to neutral.
The "Cops and Robbers" system probably only uses validators to check unit type against a list of allowed vehicles or to disallow use on units with specific attributes. I didn't bother adding these failsafes for my demo map as the ability shouldn't be accessible to players (just remove the command card buttons on the Marine and Bunker and there's no way a player can use it willingly)
If you make the bunker switch allegiance with units still inside all those units will change ownership too, so if you want to do that you have a hard limit of 2 units per transport (then you can target the remaining cargo unit for setting bunker allegiance and it's guaranteed to not rob anyone of their units, using the "reset to neutral" as the fallback option if the bunker is left empty)
You should use data for the fuel, and running anything on a 0.0s period should either lag/crash the game or be hardcoded to stop after 1 execution to prevent the former. A basic setup:
One thing you could look into for multi-player control is the Interact ability type, used by the Xel'Naga Watchtower. This can be used to share control of a single unit only. The remaining problem is that there's no "partial control" unless you set up an elaborate permissions system via triggers, and you know full well what will happen if you give 4 online players shared control of an armed vehicle (the result depends mostly on the amount of enemies in the vicinity and their relative durability compared to the vehicle)
Edit: Oh, and instead of double posting you should edit your previous post and add to it if it's still the last one in the thread. People rarely use the "quote" function around here so there'll be no problem with butchered quotes.
How would I edit the abilities you gave me to make it only affect Mechanical attribute units? And how would I make it so that the ability gives it to an allied player who is controlled by all players? (This is what I believe Cops and Robbers does)
It gives it to an allied controllable player then gives it back to an uncontrolled neutral after all units exit.
Thank you for all the help you've given so far, I really appreciate it. SoulCarverR is offering to help me with making the tank system, it would be a very neat system for character/vehicle interaction. Most maps are either really in-depth vehicles with no characters, or mediocre character/vehicle systems.
MassDestruction 2 for instance is really in-depth with vehicles, but you don't get to exit the tank and walk around as a character.
To be honest, I do not have any idea how most of this stuff works. I'm the kind of mapmaker who comes on here and asks for help. Hopefully I'll be able to make tutorials one day, haha. ^_^
You can set a target filter on the ability, or place validators somewhere in the setup. Note that for the intended structure the target filter would be irrelevant unless you make biological transports using the same Transport ability, which is dumb if you want different rules for those.
Again: the ability isn't meant to be on the command card and thus will never be used by the player themselves. The command card button on the Marine and the redirect button on the Bunker are only dummies I used for testing and didn't bother to remove.
The actual use of the ability occurs through the Transport ability, which includes an Issue Order effect to force the unit to cast the mind control ability. I tried it with applying the mind control effect directly and it didn't work, hence I added the ability.
For the shared control I still suggest you look at the Interact ability, it has a specific flag to share control of the host unit with the "interaction partner". You can also still target units inside the transport through area searches, autocasts, Issue Order effects and Order triggers allowing the "hidden" flag, players themselves can't click them though.
Well, players will be able to build their own Bunkers. So it's not a problem leaving the default one and just making a duplicate for the Vehicles.
I like the way the load/capture changes back to the neutral player when all units leave, that's spot on. So I'll try and make it so the ability you made changes it to player 5 (I have 4 players on my map). Then make it auto-cast when you right click on Mechanical Vehicles, in other terms it will be like the Cops and Robbers vehicle system.
EDIT: Got the change to player 15 (hostile), now I just need to make it so that the player's unit doesn't exit controlled by Hostile. How would I do this?
When a transport switches ownership, all cargo units also switch to the same owner. This appears to be hardcoded with no data-only way of disabling it. Giving a unit to any specific player outside of the always-uncontrollable ones (0: Neutral, 15: Hostile) doesn't work through data, you need triggers for that.
As a workaround you could run a 500 range search for a unit only the AI ally may own on your team. The enemy AI ally can be excluded through search filters. Then use this unit to define the new owner. Again, it is important that the transport is empty at the time it switches ownership.
One thing you could try is making the capture ability on the unit a "smart command" (activates on right-click) and adding an Issue Order-Enter Transport to it. In that case you'll need a waterproof validator system to ensure it won't work on any other units. I think a Combine-AND of "target cargo hold empty", "target is neutral" and a whitelist of unit types should do it. (whitelist= Combine-OR of unit type validators)
I'll see if I can make it work, Modify Unit ownership change seems a bit finicky/buggy.
Edit: This should match your requirements. I've added explanations to everything I edited, check the Editor Comment fields. The text message triggers are debugging relics, the alliance triggers are mandatory for this to function. Players 2+6 represent the enemy team, they shouldn't share control with player 1, that's a testing feature.
Edit2: The version you want is now called TeamBunker. I added an Interact ability to the old setup to allow allied units to get out of the bunker, that's NeutralBunker. No comments added to that one though. (yet)
Thank you very much, I'll try this now.
EDIT: This works perfectly except for one thing, it disables Items from being picked up because the unit is given to Player 6 when right clicked. How do I make a validator on it so that it only works on Mechanical units? Other than that, it'll be perfect. I can add the fuel system to it and voila, realistic car system.
EDIT2: Found the Target Filters on the ability, trying it now.
EDIT3: It's working perfectly after I fixed the Filter. Thank you so much for all the help, I could have never done this by myself. As for the tank, I think I'll just leave it so that multiple people can control and shoot from it.
EDIT4: So I forgot that player 6 was a computer player on my map, I implemented the ability and it worked at first. I then fixed the filter, "Perfect" I thought!.
Then a few minutes later when I was renaming and fixing the computer AI in the Player Properties, for some reason it's screwed up now and won't even load the player. I have no idea what I could have done because I have no idea how those abilities work.
And yes, I did try copying the abilities from your map back into mine again... No success. :(
I did set the triggers to ally player 6 to the first 4 players.
@Alnatair: Go
The ability took control of an item by right-clicking it? Please check the contents of the Smart Validator on the ability in your map, I included a target filter that should specifically prevent this. (CaptureNeutral TargetList)
The functionality of the setup is not built around the player numbers 5 and 6 specifically. The criteria are as follows:
"won't even load the player" sounds like you messed up the initialisation trigger or the settings defining the players themselves. This most likely has nothing to do with the transport setup, you don't have to change any of those for it to work.
I simply copied over the abilities and such into my map and made player 6 an ally to all players. I'll see if the triggers on my map are screwing up, if so then it's me.
EDIT: Trying to place an automaton and see if it works now.
EDIT: No it wasn't the automaton, I had added it just now and it still doesn't work. Note that this is all on my map. Should I just let you check my map file?
When I first copied the stuff over, it worked fine. Until I screwed around with the player properties.