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.
[10:41 am]
ManCubuS -- Seems like something's broken regarding the site then. Sadge...
[07:36 am]
Oh_Man -- have i ever told u guys my SC2 pro-gamer story
[11:30 pm]
Ultraviolet -- That's strange, it looks like you targeted the base image file (sometimes people make the mistake of just using the imgur page link which doesn't work for embedding) but it still didn't work it sounds like.
[03:34 pm]
ManCubuS -- Used : " [img=https://i.imgur.com/gpOjTuD.jpeg] "
[03:28 pm]
ManCubuS -- Even tried with imgur, doesn't attach.
[03:14 pm]
ManCubuS -- I should try a workaround, thanks! Sadly imgur is blocked in my country for some unknown reason.
[03:05 pm]
NudeRaider -- I think SEN has trouble with https or hotlinking is forbidden. It certainly is nothing about the size, it just fails to get any size. You can get it working if you use imgur and include the actual image link for the img tag. Like this: [img=https://i.imgur.com/ddYqXZa.jpeg]
[2026-7-26. : 11:15 am]
ManCubuS -- Hey fellas! Anyone knows why when I try to upload an image it says "failed to get image size"? I even tried making it so small. Imgur isn't working here and I tried postimg no luck.
[2026-7-23. : 6:40 am]
Oh_Man -- true
[2026-7-23. : 3:16 am]
RIVE -- Still annoyed there was never a trigger to stop or pause wavs.
Please log in to shout.


Members Online: l)ark_ssj9kevin