Winboats
Mar 29 2009, 10:52 pm
By: Biophysicist  

Mar 29 2009, 10:52 pm Biophysicist Post #1



Here's a little technique I figured out for making naval units work in mods, without any of the usual problems with naval units such as vision getting fucked. There are a few parts to it.

Part one: Setting up the Water terrain and locations.
1: Use some tileset editor to make sure that water is the only Low terrain on each tileset with water. Also, mark the water as walkable.
2: Use LocUnlock to set up a location (which I'll be calling LOC1 here) that covers the whole map and is only at the Low Ground elevation level.
3: Create another location (which I'll be calling LOC2 here) which is slightly larger than the largest land unit in the mod.
4: Remove the Factory flag (in the StarEdit tab of DatEdit) from all units, then set the Factory flag on all land units (but not air/water units).
5: Now, have a trigger constantly Centers LOC2 on [Factory] owned by Current Player at LOC1.
6: Have another trigger that runs the Enter Nearest Transport AI script at LOC2 if Current Player Brings at least 1 [Factory] to LOC2.
7: Now, define your naval units as land units.
Now, ships can move on water, because it's walkable. However, if a player tries to use a transport to put ground units on water, a trigger will push them back into the transport! (If you're confused about what I mean by "the Factory flag" and [Factory]: The Factory flag is used in non-modded SC to allow triggers to affect only buildings which produce units, kind of like how you can make a trigger only affect Men or only affect Buildings. Here, we are repurposing it to instead provide a convinient way to make our triggers run on only land units.)

Now, there is a problem, which is that the ships' vision gets fucked up because of the terrain height. So, in the next step, we will fix that.
1: Set your ship production buildings to not actually build the ships, but instead to produce some arbitrary air unit.
2: Use a trigger to create the ship (in the water [I'll leave the exact method of getting the ship to appear in the water up to you] ) when the player has that air unit. In the same trigger, create some air unit (I'll call it VISIONUNIT) on top of the ship for the player who owns the ship. Also, create some air unit (I'll call it CYCLEUNIT) for P12 at the same position. VISIONUNIT and CYCLEUNIT should both be flying, invisible, cloaked, invincible, and unselectable. Make sure neither are flagged as Men in the StarEdit tab of DatEdit.
3: Create a location (I'll call it LOC3). It should be pretty small.
4: Have a trigger constantly center LOC3 on CYCLEUNIT owned by P12 at LOC1.
5: Have a second trigger that centers LOC3 on [Men] owned by Any Player at LOC3, then moves all VISIONUNIT and CYCLEUNIT at LOC3 to LOC3, and gives 1 CYCLEUNIT owned by P12 at LOC3 to P11.
6: Have a trigger that gives all CYCLEUNIT owned by P11 to P12 if P12 doesn't have any CYCLEUNITs.
So, basically, the VISIONUNIT provides vision for the ship. The triggers make sure that the VISIONUNIT stays with the associated ship.

I also have a method for making naval transports work. I'll post it once I figure out how to explain it.

Did I explain my technique well, or did I confuse you? I'll be happy to re-explain it if you want.



None.

Mar 30 2009, 12:15 am Magicide Post #2

Sleeping wolves wake hungry.

Permission to do this and then shout "I'M ON A BOAT"




Mar 31 2009, 8:14 pm bajadulce Post #3



Quote from name:TassadarZeratul
Did I explain my technique well, or did I confuse you? I'll be happy to re-explain it if you want.
How about upload an example? I'd like to see it in action plz.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[05:00 pm]
lil-Inferno -- benis
[10:41 am]
v9bettel -- Nice
[01:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[10:11 pm]
Ultraviolet -- :P
[10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
Please log in to shout.


Members Online: Ultraviolet, lil-Inferno, Roy