Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Lift off / land building Script
Lift off / land building Script
Jul 19 2020, 5:29 am
By: Saox  

Jul 19 2020, 5:29 am Saox Post #1



Hi!

Is there a way to order a building owned by a player to lift off / land on location? If not, how could I preserve the buildings condition (HP) while createing a new one "landed" ?

What I am doing today is just creating a new one, but that sets the HP to 100% which is not my intention...



None.

Jul 19 2020, 9:04 am NudeRaider Post #2

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Traditionally no. But EUDs make a lot of things possible.

A pretty awkward way would be to detect the HP of the building and recreate it with that amount of hp.

Not sure if there's a way to force building to land via EUD. I'd guess removing the lift button should be easier, if that's an option for you. But I'll leave these questions open for people actually proficient with EUDs. ;)




Jul 19 2020, 1:34 pm IlyaSnopchenko Post #3

The Curious

It is pretty easy to do with AI Scripts if you use the AISE plugin. Just write a short script containing a line like this:

issue_order(Land, 1, Terran Command Center, Loc.63, Loc.37, Any, 0)

Which would order 1 Terran Command Center, owned by the player running the script, found anywhere (Loc.63 = Anywhere) to land at the location #37 (location numbers are zero-based so it would be the 38th location in SCMDraft). The script may be then run at any location, or without a location at all.



Who am I, and why should I care?

Jul 19 2020, 2:13 pm Dem0n Post #4

ᕕ( ᐛ )ᕗ

Quote from IlyaSnopchenko
It is pretty easy to do with AI Scripts if you use the AISE plugin. Just write a short script containing a line like this:

issue_order(Land, 1, Terran Command Center, Loc.63, Loc.37, Any, 0)

Which would order 1 Terran Command Center, owned by the player running the script, found anywhere (Loc.63 = Anywhere) to land at the location #37 (location numbers are zero-based so it would be the 38th location in SCMDraft). The script may be then run at any location, or without a location at all.
He's asking for trigger solutions, not modding solutions.




Jul 19 2020, 7:17 pm IlyaSnopchenko Post #5

The Curious

Huh... all right, althought I don't think the OP said anything about a trigger solution specifically. There seems to be no trigger solution anyway, maybe something esoteric from the EUD realm.



Who am I, and why should I care?

Jul 19 2020, 7:28 pm Dem0n Post #6

ᕕ( ᐛ )ᕗ

Well this is in SC1 UMS Map Making Assistance, so odds are that he's looking for a trigger solution. :P




Jul 20 2020, 5:27 am Saox Post #7



Quote from IlyaSnopchenko
It is pretty easy to do with AI Scripts if you use the AISE plugin. Just write a short script containing a line like this:

issue_order(Land, 1, Terran Command Center, Loc.63, Loc.37, Any, 0)

Which would order 1 Terran Command Center, owned by the player running the script, found anywhere (Loc.63 = Anywhere) to land at the location #37 (location numbers are zero-based so it would be the 38th location in SCMDraft). The script may be then run at any location, or without a location at all.

How is this done ? What software etc? Can it later be imported as a trigger to SCM Draft ?



None.

Jul 20 2020, 6:50 am NudeRaider Post #8

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

What he suggests falls into the realm of modding. You will have to create your own .exe file and everyone who wants to play your mod will have to download it before hand. Then you can even play it over battle.net, but with these people only. Battle.net will not automatically distribute the mod like it does with a map file when a player doesn't have it. This is the reason why Demon mentioned it.

So if this is acceptable for you I'd move your topic to Modding Assistance. That forum section has topics about modding tools to answer your question and will be read by people that can help you get up to speed.

Post has been edited 1 time(s), last time on Jul 20 2020, 10:27 am by NudeRaider.




Jul 20 2020, 8:54 am Saox Post #9



I understand. Many thanks! :-)



None.

Jul 20 2020, 5:40 pm IlyaSnopchenko Post #10

The Curious

Well... yes. You need to get PYMS (no idea if the other AI editors support extended commands). Probably this version: https://github.com/neivv/PyMS

1. Get the scripts\aiscript.bin and scripts\bwscript.bin from the game archives (PYMS provides clean default versions methinks).

2. Edit one of the blank scripts to include the liftoff order for the relevant buildings, and save them.

3. Edit the map specifying to run that AI Script (most of those only run for computer players, with very few exceptions) under the conditions of your choosing. Obviously you need to do these two parts concurrently as you need to specify the locations where the building is, and where it should be landed, as I had written before; you need either the exact location IDs that are made obvious only after you've created these locations in the editor, or the specific coordinates).

4. Build a mod with AISE present (I'm not sure where to get a compiled version as Neiv's there only seems to be the source code on Neiv's github. The exact procedure depends on which version of SC you're using. I can only speak for Remastered. The modloader SAMASE has its own thread here: http://www.staredit.net/topic/17430/ If you use it, you need to create a mod with the scripts\aiscript.bin, scripts\bwscript.bin, and samase\aise.dll. Also add a plain text file called 'plugins' to the samase\ folder containing the names of all the plugins you're going to use, in this case just:
samase/aise.dll

5. Patch the game.

P.S. In my case the landing script invoked during a mission looks like this:

# stat_txt.tbl entry 1348: Brood Wars Protoss 1 - Town D<0>
PB1D(1348, 101, bwscript):
issue_order(Land, 1, Terran Command Center, Loc.63, Loc.37, Any, 0)
issue_order(Land, 1, Terran Barracks, Loc.63, Loc.42, Any, 0)
issue_order(Land, 1, Terran Factory, Loc.63, Loc.53, Any, 0)
stop()

It replaces a blank Brood War script, of which there are 55ish, so you can write literally as many of them as you need. However, if you feel like conserving script slots and not doing separate ones for every little action like this, AISE also allows to evaluate death counters and jump accordingly, so setting a particular death counter through triggers right before a script is run and evaluating that same counter in the script's beginning allows for amazing branching.

The guide for basic (Starcraft and Brood War) AI commands is found here: http://pr0nogo.wikidot.com/rs-ai
The guide for extended (AISE) commands is found here: http://pr0nogo.wikidot.com/rs-ext-ai

I should note that issue_order is a goldmine of potential uses as it solves the long standing gripe of map authors being unable to issue any command other than move, attack or patrol to units. Even though it's done in a rather roundabout way, it still opens a new level of customizability when doing triggers.



Who am I, and why should I care?

Jul 25 2020, 7:46 am Sie_Sayoka Post #11



It should be possible to directly order the unit to land/lift via EUDs. It requires knowledge of CUNIT and a system built around it if you have a variable unit index. Lifting will be easy but landing may be difficult if there's unbuildable terrain.



None.

Jul 25 2020, 9:17 am NudeRaider Post #12

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

From what he described I doubt the buildings are over unbuildable terrain, unless flown there.

What about the option to prevent lifting in the first place?




Jul 25 2020, 10:21 am IlyaSnopchenko Post #13

The Curious

Doesn't EUD allow for, ah, adding custom AI Scripts?



Who am I, and why should I care?

Jul 25 2020, 6:39 pm Sie_Sayoka Post #14



Lifting can be prevented by simply removing the buttons on the command card. Creating a new unit with the detected HP amount would be a good idea as suggested earlier.

Yes, EUDs allow for custom AI scripts.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[05:16 pm]
Vrael -- just completely retarded opinions that he cobbled together from watching people who presumably knew what they were talking about, but he doesn't, so he just tries to sound like them
[05:14 pm]
Vrael -- or shit like "One wraith makes zerg obsolete. Fact."
[05:13 pm]
Vrael -- and his professional casting is garbage too, he's constantly saying stuff like "Wow ask any pro, you should always. ALWAYS. always. have 17 zealots out by the 2 minute mark as zerg. ALWAYS."
[05:13 pm]
Vrael -- m.0.n.3.y
m.0.n.3.y shouted: Vrael why do you say that?
watch any of his stream, he is the whiniest little bitch on the planet
[02:29 pm]
MTiger156 -- u
[06:58 am]
NudeRaider -- m.0.n.3.y
m.0.n.3.y shouted: Mini Game Party was featured on Artosis's channel recently! Pretty cool win for UMS: https://www.youtube.com/watch?v=gSydfyOfOpI
"xKrayZee sux"
[04:36 am]
m.0.n.3.y -- Vrael why do you say that?
[12:03 am]
Vrael -- thats awesome money, for you, but artosis is a giant turd of a human being
[10:12 pm]
RdeRenato -- a
[09:59 pm]
m.0.n.3.y -- Mini Game Party was featured on Artosis's channel recently! Pretty cool win for UMS: https://www.youtube.com/watch?v=gSydfyOfOpI
Please log in to shout.


Members Online: RdeRenato