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.
[09:05 am]
O)FaRTy1billion[MM] -- :)
[04:06 pm]
Wing Zero -- rage
[2020-9-27. : 1:50 am]
Ultraviolet -- :wob:
[2020-9-26. : 8:52 pm]
NudeRaider -- good. gooooood.
[2020-9-26. : 4:45 pm]
Wing Zero -- Rage
[2020-9-26. : 3:13 pm]
Suicidal Insanity -- Wing Zero
Wing Zero shouted: Demon stop taking my box I'm bout to rage
I ensured he couldn't
[2020-9-25. : 6:21 pm]
NudeRaider -- well he's not wrong ;)
[2020-9-25. : 5:41 pm]
jjf28 -- the video meme master
[2020-9-25. : 5:39 pm]
sraw531 -- who are you to say what meme I intended>
[2020-9-25. : 3:14 am]
jjf28 -- sraw531 wrong meme, https://youtu.be/jZ6nF6JKtRc
Please log in to shout.


Members Online: Roy, O)FaRTy1billion[MM]