Staredit Network > Forums > SC1 UMS Theory and Ideas > Topic: Integrating SCA to work with your map
Integrating SCA to work with your map
Sep 7 2020, 3:46 am
By: lifebot  

Sep 7 2020, 3:46 am lifebot Post #1



SCA is a third party utility that runs in the background while playing StarCraft.

It is much like SCDB from 2 years ago, but vastly improved in all areas.

The tool is developed by JPoker, who is also the mastermind behind EUD Editor 1,2,3.



--- Quick Facts ---

-SCA replaces SCDB
-SCDB has been abandoned
-SCA works much better than SCDB
-It is made by JPoker, highly reputable in the scene



--- Registering on SCA as user ---

First, launch SCA. When you run it for the first time, it will ask to create a password.

Create a password, and then it will ask for your e-mail address. Enter your e-mail, it will send a verification code to finish registering.

At this point, you can now use SCA to play other SCA-enabled maps.


--- Integrating SCA in your map ---

Please note that SCA saves death values, so decide which death values you want saved prior to doing this.

Launch EUD Editor 3 latest version, and open the TE editor.



Expand the left side bar and you will see this. Click the settings icon



Fill out the info, as shown in the screen shot.



Now go back to the side bar, and right click on your e3s file and create new CUI epScript.

Rename the epScript to English characters no spaces.

Now open the CUI epScript file you just created.



You will see this window. There won't be anything in your file.

Now, you need to copy and paste this code:

/////////////////////////////////////

import TriggerEditor.SCArchive as sca;

function onPluginStart(){
sca.Init();
}

function beforeTriggerExec(){
EUDPlayerLoop()();
sca.Exec();

if(Deaths(CurrentPlayer, Exactly, 1, "Terran Firebat")){ // Data Save
SetDeaths(CurrentPlayer, SetTo, 0, "Terran Firebat");
sca.SaveData(0);
}

if(Deaths(CurrentPlayer, Exactly, 2, "Protoss Nexus")){ // Data Load
SetDeaths(CurrentPlayer, SetTo, 3, "Protoss Nexus");
switch(sca.GetLastMessage()){
case 1:
sca.LoadData(0);
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
case 7:
break;
case 8:
break;
case 9:
break;


default:
sca.ResetLastMessage();
}
}


EUDEndPlayerLoop();
}

function afterTriggerExec(){
}


////////////////////////////////////

As you can see, what triggers SCA to load and save are:

sca.SaveData(0);
sca.LoadData(0);

In this code, the condition for executing the save and load are the death triggers.

Ex:

if(Deaths(CurrentPlayer, Exactly, 1, "Terran Firebat")){ // Data Save
SetDeaths(CurrentPlayer, SetTo, 0, "Terran Firebat");

This means when a player has a death of 1 firebat, it sets it to 0 again and executes the save.

Simply edit the death value of the unit applicable to your own map and you should have a working save/load trigger.

You can also use other classic triggers as conditions. Make sure to follow the syntax/coding structure.

I will expand on this topic as soon as possible.

Post has been edited 20 time(s), last time on Sep 7 2020, 11:23 am by lifebot.




Sep 7 2020, 8:19 am Oh_Man Post #2

Find Me On Discord (Brood War UMS Community & Staredit Network)

Nice work sir. I look forward to more!




Sep 7 2020, 11:14 am lifebot Post #3



Done, for now.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:12 pm]
Oh_Man -- don't read page 8 of the Tenebrous thread unless you want a broken heart
[01:53 pm]
lil-Inferno -- ya, 12 years and you still haven't finished it smh
[05:32 am]
Vrael -- has it been that long?
[05:32 am]
Vrael -- nice
[03:38 am]
lifebot -- I thought it was good considering it was made 12 yrs ago
[11:19 pm]
Vrael -- lifebot
lifebot shouted: I was playing ur map
cool, did you like it?
[2020-10-25. : 9:38 pm]
NudeRaider -- t1mz_
t1mz_ shouted: Is it possible in SC1 to make air units fly around an obstacle, sort of "unflyable" terrain, like unwalkable for ground units ?
creating a no fly zone isn't too hard. just order units that enter a location to somewhere else. the hard part is keeping the order they previously had. It's probably doable with some eud fu and heavy constraints and/or clunky result. Even then, it's going to a lot of work and no guaranteed result. So I'd stick to the no fly zone.
[2020-10-25. : 4:43 pm]
lifebot -- The Tenebrous
[2020-10-25. : 4:42 pm]
lifebot -- I was playing ur map
[2020-10-25. : 4:42 pm]
lifebot -- Vrael
Please log in to shout.


Members Online: Roy, Dem0n, Oh_Man, Moose, jjf28, sraw531