Help with vehicles?

hi111111111

New Member
Reaction score
0
Hi! =D It's my first time here, could someone help me with 2 problems?
I made a hero who has an ability (based on Tinker's pocket factory) but summons a siege engine instead. The siege engine has load and unload abilities.

1. My problem is that I want the vehicle to be like a car. The siege engine should not be movable when there is no one loaded, but when there is someone inside the vehicle, it should be movable. (it's like a non-autopiloted vehicle)

2. If someone could help me with this other problem... So you've read my above problem, I plan to give my hero an ability where he summons units that can get in the siege engines and drive them (just like the hero)

For short, there needs to be a unit inside the vehicle to drive it and make it move.

Could someone help me with these, PLEASE!
Any help is appreciated =D
 

Tothumn

New Member
Reaction score
4
You should use a trigger that fires when a unit is summoned, check whether the summoned unit's type is siege engine, and if true then pause the unit.
Another trigger fires when a unit is loaded in a transport and unpauses the transporting unit.

In that case if you cant load into a paused unit try to set its movement speed to 1 instead.(you will have to change the minimum speed to 1 too in advanced/gameplayconstants). Then when a unit is loaded into a transport ,set the transporting units movement speed to 300 or whatever it original speed was.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
you can give the "car" ward classification (removes attack move hold/ability icons) so its a blank unit interface, then have the event a unit is issued an order targeting a point or a unit, if the unit is the car check how many units its holding and if its greater than or equal to 1 order the car to hold position, that way when it is ordered to do something instead it will hold position or stop if it isnt loaded
 

hi111111111

New Member
Reaction score
0
Thanks =D +rep
I've made it stop
but how do I make the game check whether or not the siege engine has a unit loaded?
 

death_knight

Dark is the heart of a corrupted man.
Reaction score
24
Well when the vehicle is bought by/created for the user, it has no units loaded into it, so what you do is you set an integer variable to 0 and every time a unit is loading into the vehicle, add 1 to the variable; and when a unit is unloaded from the vehicle, subtract 1 from the variable. In this way, you will know whether or not the vehicle has any units in it because if it has no units loaded into it, the variable will be 0.
 

hi111111111

New Member
Reaction score
0
Well when the vehicle is bought by/created for the user, it has no units loaded into it, so what you do is you set an integer variable to 0 and every time a unit is loading into the vehicle, add 1 to the variable; and when a unit is unloaded from the vehicle, subtract 1 from the variable. In this way, you will know whether or not the vehicle has any units in it because if it has no units loaded into it, the variable will be 0.

Sorry, I'm new to triggers, where exactly do I go/click? =/
 

Tothumn

New Member
Reaction score
4
EDIT: I think death_knights idea only works with a single car!
It would let every car to move even if only one of them has a driver.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
You can add arrays or store the integer in a hashtable. It wouldn't be hard.
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top