|
Post by keepitsimple on Feb 16, 2020 12:24:46 GMT 1
Hi Mappers,
Sometimes you get in a game that supply and sapper trucks commit suicide by running straight into enemy lines. The reason that this happens is because a warehouse behind the enemy line is assigned to player and as it closer the trucks move there. If the warehouses behind the enemy line are assign to enemy this will not happen. Throwback, if player takes such a warehouse trucks will not automatically go there to refill. First you need to place a squad inside to use it and the player has to send his trucks there or they go back automatically to original warehouse to refill.
This problem is only related to true warehouses and not to field supply depots.
By script you might be able to solve this problem. If you check if the warehouse is occupied by the player then you could change the building to the player. This has to be tested but this might work.
This doesn't work. You can't seem to change the player of a warehouse by script. You can't also not delete a warehouse by script (and hence replace it with a new one).
|
|
kaoz
General
inter faesces et urinam nascimur
Posts: 1,112
|
Post by kaoz on Feb 17, 2020 20:40:39 GMT 1
You can't also not delete a warehouse by script (and hence replace it with a new one). kis, you could attach the building with ScriptID to a reinforcement and then delete it with killreinforcement. But it would be weird to see warehouses disappear and reappear whenever you catch one, no? Easier to just put a squad in it, i guess, and keep an eye on those trucks.
|
|
|
Post by keepitsimple on Feb 17, 2020 20:56:22 GMT 1
Hi kaoz, I did give both warehouses a scriptID and where LandReinforcement works, DeleteReinforcement doesn't. If you leave just a 10th of second between delete and land command you would as player almost not notice the replacement.
|
|
kaoz
General
inter faesces et urinam nascimur
Posts: 1,112
|
Post by kaoz on Feb 19, 2020 23:01:55 GMT 1
LandReinforcement works, DeleteReinforcement doesn't. DeleteReinforcement should work... I never tried it on Warebases however. Have you tested without Field Supplies? I can only think their connection with the WB might prevent it from being deleted. It works with any other building, right?
|
|
|
Post by keepitsimple on Feb 19, 2020 23:33:47 GMT 1
Warehouses are special. For instance, they are the only think that can't be destroyed. (and not delete it seems)
I had no Field supplies. I had three warehouses, the player has one and AI has two at the start. Of which the one in the middle is placed as LandReinforcement after a few seconds after the start of the game. This one I tried to change sides or delete/replace.
|
|
|
Post by keepitsimple on Jan 24, 2022 23:22:58 GMT 1
The problem of not being able to remove a warehouse by script seem to be simple that you can't remove a building from a map. You can add a building to map as a reinforcement so isnt there from the beginning. But ones on the map you can remove it. I have a LCM-3 which is a building. On the plus side you can land it with a truck or tank inside. You can land them as reinforecment with doors close (upper picture) and then by script open the ramp so the truck or tank can move out. Once the unit is clear of the LCM you can even closed the ramp by script again. However. you cann't seem to let it disappear again by using DeleteReinforcement.
|
|