| 09-22-2003, 05:06 AM | #1 |
I've been doing work on some transport triggers. Mainly, I've been trying to make a transport unit that allows any player to just hop in. Only problem is, I don't know why, but I've managed to crash wc3 a lot. I think it's due to ownership issues. Would someone be able to tell me if there's an ability of unloading? I mean, unloading when I click on a portrait in the cargo. I think that would help greatly. BTW, this is a multiplayer map. |
| 09-22-2003, 05:20 AM | #2 |
Give it all the abilities that a goblin zepplin has. |
| 09-22-2003, 05:26 AM | #3 |
My problem is this: When a transport is empty, it belongs to neutral passive (to show that it's empty, and also so that AI creeps don't attack it). When I "smart" on an empty transport with a hero, and the hero is in range, it transfers ownership of the transport to the player who owns the triggering hero. When I unload, I transfer the ownership of the transport back to neutral passive. That's all fine and good, but I can only detect the unload order being issued, and not the unloading being done, so I end up losing my hero inside the tank, or getting a hero outside the tank which belongs to neutral passive. If I knew which ability was unloading using the portrait, I would be able to detect when the ability was finished, and only then would I transfer ownership of the transport back to the neutral passive. |
| 09-22-2003, 08:53 AM | #4 |
Listen to the Draco. Give it all the abilities that goblin zepplin has. Load and unload are not all. The goblin zepplin has 2 other abilities i believe to store units. If you've already solved this, now for the ownership thing. 1) I foresee problems with multiple heroes approaching a transport. Maybe this doesn't apply for your map so if it doesn't, I didn't say anything. 2) Rather than detecting the goblin zepplin dropping the unit, detect the unit getting dropped. I think dropping a unit is when a unit enters playable map region or something. Then detect if the unit is the unit from the zepplin, and convert the zepplin. Ho Hum there are probably other ways if you don't want creeps to attack your zepplin. Just tell us the context and purpose and all. |
| 09-22-2003, 01:53 PM | #5 |
Thanks for the info. I'm going to try to detect the heros entering playable map area. As far as the abilities go, I already have everything working, it's just that sometimes (rarely) it crashes (all players get crashed to windows). I guess it doesn't really "work" if it crashes :) Edit: Oh, one more thing. I've heard that the system that a certain map, Battlefield, uses is quite different, as it detects units approaching the vehicle. My way is different, as I detect the "smart" order ON the vehicle from a hero. Also, I detect whether or not the ordered unit is in range of the target unit of issued order. |
| 09-22-2003, 03:29 PM | #6 |
I've done something similar to this for a map I'm working on. I too have immobile units until a hero loads into them, which become immobile again once the hero unloads. But mine are acutally owned by the player. I discovered that there are actually two unload commands. Clicking on the unit portrait in the cargo display issues an "unload" order, but using the Unload All ability of the transport is a different action. I have two different triggers, one to detect Order = Unload and another to detect Ability Cast = Unload (Air Transports). Not sure if this helps, but maybe it does... |
| 09-22-2003, 05:03 PM | #7 |
Unfortunately, when I detect the order, there's always the delay between the order and the actual unload sequence finishing. If you stun the vehicle (I allow mechanical targets for spells like Storm Bolt, as well as bash on mechanical), that creates a problem, as if you try to transfer ownership of a stunned unit, it wants to crash :P I've since made the vehicle magic immune. I've reworked the code and used custom values on heros and vehicles. Basically, in pseudo code, I made a loop like this: Event - Every 2 seconds elapsed - foreach (tank in Unit-Group(Units_in_Region(Map) of type Vehicle)) { if (!isTransported(hero[tank.cv])) { ChangeOwner(tank); tank.cv = 0; hero.cv = 0; addAbility(tank, Load); } } So that I no longer detect the unload event, but rather do a poll. I disallow any hero with a cv (custom value) of 1 from loading onto a tank, as they should already be loaded onto a tank, or are just getting out. Oh, also, I remove the load ability from the tank when I detect an unload event that targets a hero, so that, until ownership has been transfered to neutral passive, the tank itself can't load anything. If anyone has any questions about this, ask me. |
| 09-22-2003, 05:57 PM | #8 | |
This may not help your specific situation, but what I'm doing rather than pausing the unit or changing its ownership is replacing it with a duplicate unit with no movement or attack. Just for reference, here's my Triggers. Glitter Boy is the stationary transport unit, and Glitter Boy (Mobile) is the one that moves and attacks. Quote:
|
