Requirements:
SCMDraft 2
TrigEdit++
EUD Editor 2
Included files(if applicable)
Changing Player, Minimap and Chat Colors
Collapse Box
Step 1: Download the included PColor.lua
Step 2: Create a folder called "lua" inside your scmdraft2 folder, place PColor.lua inside of the new lua folder
Step 3: Open SCMDraft2 and use TrigEdit++
Step 4: Copy the following code into the trigger pane for your actions
PColor (0-7, 0-255);
MColor ({0, 0-255}, {1, 0-255}),
Explanation:
PColor controls the color of the players units and chat display, MColor controls the color of the minimap
You must first select the player it affects (0-7) then choose the color you wish to apply (0-255)
Once values have been changed to desired colors, compile and save, you are done!
The output in TrigEdit++ should now look similar to this:
SetMemory(0x581D74, SetTo, 3735552);
SetMemory(0x581DD4, SetTo, 960036864);
Step 2: Create a folder called "lua" inside your scmdraft2 folder, place PColor.lua inside of the new lua folder
Step 3: Open SCMDraft2 and use TrigEdit++
Step 4: Copy the following code into the trigger pane for your actions
PColor (0-7, 0-255);
MColor ({0, 0-255}, {1, 0-255}),
Explanation:
PColor controls the color of the players units and chat display, MColor controls the color of the minimap
You must first select the player it affects (0-7) then choose the color you wish to apply (0-255)
Once values have been changed to desired colors, compile and save, you are done!
The output in TrigEdit++ should now look similar to this:
SetMemory(0x581D74, SetTo, 3735552);
SetMemory(0x581DD4, SetTo, 960036864);
Detecting Player Name
Collapse Box
Step 1: Download the included CheckName.tfn
Step 2: Open EUD Editor 2 and go to the Advanced View of Trigger Editor
Step 3: With the functions section selected, click the Load(L) button on the left, select the new CheckName.tfn
Step 4: When expanded you should now see the following:
Step 5: Select the onPluginStart section and click If(I) button on the left
Step 6: Select the If condition then the Func (F) button on the left
Step 7: Choose your desired player to check for and the Name you wish to examine. Use whichever actions you wish.
Step 2: Open EUD Editor 2 and go to the Advanced View of Trigger Editor
Step 3: With the functions section selected, click the Load(L) button on the left, select the new CheckName.tfn
Step 4: When expanded you should now see the following:
Step 5: Select the onPluginStart section and click If(I) button on the left
Step 6: Select the If condition then the Func (F) button on the left
Step 7: Choose your desired player to check for and the Name you wish to examine. Use whichever actions you wish.
Changing Player Name
Collapse Box
Step 1: Download the included namechange.py and customText.py
Step 2: Move both of these files into your EUDDraft/libs folder
Step 3: Open EUD Editor 2 and go to the Advanced View of Trigger Editor
Step 4: In the white box above the trigger pane, add the following code:
import namechange;
import customText as ct;
Step 5: With the beforeTriggerExec section selected, click the Act (A) button on the left
Step 6: Go to the custom tab, select the RawCode option, and enter the following:
namechange.Locate();
Step 7: Select afterTriggerExec section and click For (R) button on the left
Step 8: Select Player Loop and check which players you would like it to affect
Step 9: With the action portion selected, click Act (A) and again go to the custom tab and choose RawCode, enter the following:
const player = tct.str(0x57EEEB + getcurpl() * 36)
Step 10: Repeat step 9 and enter the following:
const color = tct.color(getcurpl())
Step 11: Click If(I) button on the left to create a trigger; use whatever conditions you desire. For the action, use the following:
namechange.NewName(CurrentPlayer, color, player, "YOUR TEXT HERE")
It should now look similar to:
Explanation:
namechange.NewName(CurrentPlayer, color, player, "YOUR TEXT HERE")
namechange.NewName = Function we are using
(CurrentPlayer, = Player it affects
color, = Apply player color to text
player, = Apply player name to text
"YOUR TEXT HERE") = Self-Explanatory
The text can be used to add before or after name by swapping out the arguments like so:
After name: namechange.NewName(CurrentPlayer, color, player, "TEXT HERE")
Before name: namechange.NewName(CurrentPlayer, "TEXT HERE", player)
Step 2: Move both of these files into your EUDDraft/libs folder
Step 3: Open EUD Editor 2 and go to the Advanced View of Trigger Editor
Step 4: In the white box above the trigger pane, add the following code:
import namechange;
import customText as ct;
Step 5: With the beforeTriggerExec section selected, click the Act (A) button on the left
Step 6: Go to the custom tab, select the RawCode option, and enter the following:
namechange.Locate();
Step 7: Select afterTriggerExec section and click For (R) button on the left
Step 8: Select Player Loop and check which players you would like it to affect
Step 9: With the action portion selected, click Act (A) and again go to the custom tab and choose RawCode, enter the following:
const player = tct.str(0x57EEEB + getcurpl() * 36)
Step 10: Repeat step 9 and enter the following:
const color = tct.color(getcurpl())
Step 11: Click If(I) button on the left to create a trigger; use whatever conditions you desire. For the action, use the following:
namechange.NewName(CurrentPlayer, color, player, "YOUR TEXT HERE")
It should now look similar to:
Explanation:
namechange.NewName(CurrentPlayer, color, player, "YOUR TEXT HERE")
namechange.NewName = Function we are using
(CurrentPlayer, = Player it affects
color, = Apply player color to text
player, = Apply player name to text
"YOUR TEXT HERE") = Self-Explanatory
The text can be used to add before or after name by swapping out the arguments like so:
After name: namechange.NewName(CurrentPlayer, color, player, "TEXT HERE")
Before name: namechange.NewName(CurrentPlayer, "TEXT HERE", player)
Detecting Key Presses
Tutorial was made before I had an account here; Roy was kind enough to post the guide at: http://www.staredit.net/topic/17739/
Using Text Effects
Collapse Box
Step 1: Download the included texteffect.py, customText.py and eudx.py
Step 2: Move all of these files into your EUDDraft/libs folder
Step 3: Open EUD Editor 2 and go to the Advanced View of Trigger Editor
Step 4: In the white box above the trigger pane, add the following code:
import texteffect as te;
import customText as ct;
Step 5: With the afterTriggerExec section selected, click the Act (A) button on the left
Step 6: Select the custom tab and then the RawCode option, enter the following code:
ct.setlocalcp()
Step 7: With afterTriggerExec still selected, click the If(I) button to add a trigger - use whatever you like for the condition
Step 8: With the Action on new trigger selected, click the If(I) button to add a nested condition, enter the following code for the condition:
!te.fadein('\x07\x13This is using a Wait of 1', color = py_eval('(0x1B, 0x04, 0x1E, 0x14)'), wait=1, timer=py_str('tim1'), line=1)
Step 9: Repeat Step 8 for the new action, but enter the following code for the condition:
!te.fadeout('\x07\x13This is using a Wait of 1', color = py_eval('(0x1B, 0x04, 0x1E, 0x14)'), wait=1, timer=py_str('tim2'), line=1)
Step 10: Repeats Step 8 and 9 using the following code for actions:
te.reset('tim1');
te.remove('tim2');
Explanation:
!te.fadein('\x07\x13This is using a Wait of 1', color = py_eval('(0x1B, 0x04, 0x1E, 0x14)'), wait=1, timer=py_str('tim1'), line=1)
!te.fadein( = Function we are using
!te.fadeout( = Function we are using
'\x07\x13This is using a Wait of 1', = Text you would like to display
color = py_eval('(0x1B, 0x04, 0x1E, 0x14)'), = Colors it will use to cycle through
wait=1, = The amount of delay in between character display (Value 1-3)
timer=py_str('tim1'), = A string we will use for the timer
line=1) = The line we want the text on
te.reset = Stop Fade-In function and Start Fade-Out
te.remove = Stop Fade-Out function and Start Fade-In function(if applicable)
Step 2: Move all of these files into your EUDDraft/libs folder
Step 3: Open EUD Editor 2 and go to the Advanced View of Trigger Editor
Step 4: In the white box above the trigger pane, add the following code:
import texteffect as te;
import customText as ct;
Step 5: With the afterTriggerExec section selected, click the Act (A) button on the left
Step 6: Select the custom tab and then the RawCode option, enter the following code:
ct.setlocalcp()
Step 7: With afterTriggerExec still selected, click the If(I) button to add a trigger - use whatever you like for the condition
Step 8: With the Action on new trigger selected, click the If(I) button to add a nested condition, enter the following code for the condition:
!te.fadein('\x07\x13This is using a Wait of 1', color = py_eval('(0x1B, 0x04, 0x1E, 0x14)'), wait=1, timer=py_str('tim1'), line=1)
Step 9: Repeat Step 8 for the new action, but enter the following code for the condition:
!te.fadeout('\x07\x13This is using a Wait of 1', color = py_eval('(0x1B, 0x04, 0x1E, 0x14)'), wait=1, timer=py_str('tim2'), line=1)
Step 10: Repeats Step 8 and 9 using the following code for actions:
te.reset('tim1');
te.remove('tim2');
Explanation:
!te.fadein('\x07\x13This is using a Wait of 1', color = py_eval('(0x1B, 0x04, 0x1E, 0x14)'), wait=1, timer=py_str('tim1'), line=1)
!te.fadein( = Function we are using
!te.fadeout( = Function we are using
'\x07\x13This is using a Wait of 1', = Text you would like to display
color = py_eval('(0x1B, 0x04, 0x1E, 0x14)'), = Colors it will use to cycle through
wait=1, = The amount of delay in between character display (Value 1-3)
timer=py_str('tim1'), = A string we will use for the timer
line=1) = The line we want the text on
te.reset = Stop Fade-In function and Start Fade-Out
te.remove = Stop Fade-Out function and Start Fade-In function(if applicable)
Useful EUD Tricks
Use Arrays to store or convert data:
Collapse Box
In the white box above trigger pane, enter the following code:
const Ranking = [EncodeString("\x08 ★★★★★"), EncodeString("\x04 ★★★★☆"), EncodeString("\x04 ★★★☆☆"), EncodeString("\x04 ★★☆☆☆"), EncodeString("\x04 ★☆☆☆☆"), EncodeString("\x04 ☆☆☆☆☆")];
Example Usage: Player has suffered 0 deaths of marine. Instead of displaying 0 for the value in-game, it would show ★★★★★. If marines death was 3, it would show ★★☆☆☆ instead.
You can attach it to a death counter using the following code:
tct.s2u(tct.strptr(ARRAYNAMEHERE[dwread_epd(0-255 * 12 + 0-7)]))
Change the array name to match your array, and specify the unit you would like to attach to array (0-255) and the player it would attach to (0-7)
An in-game example(used to give grade for ob completion in a bound)
const Ranking = [EncodeString("\x08 ★★★★★"), EncodeString("\x04 ★★★★☆"), EncodeString("\x04 ★★★☆☆"), EncodeString("\x04 ★★☆☆☆"), EncodeString("\x04 ★☆☆☆☆"), EncodeString("\x04 ☆☆☆☆☆")];
Example Usage: Player has suffered 0 deaths of marine. Instead of displaying 0 for the value in-game, it would show ★★★★★. If marines death was 3, it would show ★★☆☆☆ instead.
You can attach it to a death counter using the following code:
tct.s2u(tct.strptr(ARRAYNAMEHERE[dwread_epd(0-255 * 12 + 0-7)]))
Change the array name to match your array, and specify the unit you would like to attach to array (0-255) and the player it would attach to (0-7)
An in-game example(used to give grade for ob completion in a bound)
Read data dynamically
Collapse Box
You can display dynamic data to make text display as well as variables much easier to manage/utilize. The above example image was using 1 trigger with 1 action to display everything.
You will use the RawCode option on the custom tab for this
Reading Death Counters: dwread_epd(0-255 * 12 + 0-7) OR dwread_epd(0 * 12 + getcurpl())
Reading Player Name: tct.str(0x57EEEB + 36 * 0-7) OR tct.str(0x57EEEB + 36 * getcurpl())
Reading Custom Score: (dwread_epd(EPD(0x5822F4 + 4 * 0-7) OR dwread_epd(EPD(0x5822F4 + 4 * getcurpl()))
Reading Variables: VariableName(no quotes)
Example Usage:
Text Display(Default) - tct.print("", dwread_epd(0 * 12 + 0), ""); <----Always displays death counts of marine for player 1
SetScore(Custom) - dwread_epd(0 * 12 + 0) = (dwread_epd(EPD(0x5822F4 + 4 * 0) <----Player 1 Score is always equal to Marine Deaths for Player 1
Arithmetic (General) - TotalDeaths = dwread_epd(0 * 12 + 0) + dwread_epd(0 * 12 + 1) + dwread_epd(0 * 12 + 2) <----Marine Deaths added for players 1,2,3 and assigned to the variable "TotalDeaths"
You will use the RawCode option on the custom tab for this
Reading Death Counters: dwread_epd(0-255 * 12 + 0-7) OR dwread_epd(0 * 12 + getcurpl())
Reading Player Name: tct.str(0x57EEEB + 36 * 0-7) OR tct.str(0x57EEEB + 36 * getcurpl())
Reading Custom Score: (dwread_epd(EPD(0x5822F4 + 4 * 0-7) OR dwread_epd(EPD(0x5822F4 + 4 * getcurpl()))
Reading Variables: VariableName(no quotes)
Example Usage:
Text Display(Default) - tct.print("", dwread_epd(0 * 12 + 0), ""); <----Always displays death counts of marine for player 1
SetScore(Custom) - dwread_epd(0 * 12 + 0) = (dwread_epd(EPD(0x5822F4 + 4 * 0) <----Player 1 Score is always equal to Marine Deaths for Player 1
Arithmetic (General) - TotalDeaths = dwread_epd(0 * 12 + 0) + dwread_epd(0 * 12 + 1) + dwread_epd(0 * 12 + 2) <----Marine Deaths added for players 1,2,3 and assigned to the variable "TotalDeaths"
Edit Unit Stats/Display in Real-Time
Collapse Box
Using the following methods you can change the physical appearance of unit, the displayed information, as well as the stats and capabilities; all in real-time.
Changing Stats and/or capabilities: Create a new action, and select SetDatFile from the EUD tab.
You will have different options depending on what DatFile you select - we will start with units.dat for this example
Here we can edit things like the graphics the unit uses, the hit points, whether it has shields, etc etc. Some actions will require the unit to be respawned for the changes to appear.
This process can be repeated for things like weapon.dat to change damages, attack types, animations, etc.
Changing Displayed Info of unit: Open DatEdit, and proceed to "FileManager". On the list that appears, find a unit you would like to edit. I will be editing a zergling in this example.
Edit the name of the unit you would like to edit something such as this: ####################### This is to ensure that if we change the name of the unit, the "new" name is not longer than the old one. (Can cause centering issues)
Save your change, and go back to Trigger Editor. Now we will be using the "ChangeStarText" option in the EUD tab. Find your newly edited unit in the list:
The number can remain 0, but for the Text we will use a dynamic solution from above; We will also add an array to the name to pull the "guild rank" as shown in example.
tct.str(0x57EEEB + 36 * 0), tct.s2u(tct.strptr(CRanking[dwread_epd(0 * 12 + 0)])) <---A comma "," separates the 2 different functions. In this example, player 1 is the target.
We can go further by adding a secondary line under name to display additional info. In the below example I use it to display Remaining Lives. Open DatEdit and go to the "Advanced" tab of the unit you wish to edit. Select the "Detector" checkbox from the flags list. Go back to TriggerEditor and again create a new action using ChangeStarText.
This time we will select <3>Detector from the list instead of unit name. We can use a read-array function as described earlier to display our desired info. In this case I have simply attached it to player's custom score.
"\x1CRemaining Lives: \x04",dwread_epd(EPD(0x5822F4 + 4 * 0)), "\x14" <----Static text has quotes "" around it, functions do not. A comma , is needed to separate these.
Congrats, you now have a completely custom unit that pulls dynamic data from different sources to truly customize your unit.
Changing Stats and/or capabilities: Create a new action, and select SetDatFile from the EUD tab.
You will have different options depending on what DatFile you select - we will start with units.dat for this example
Here we can edit things like the graphics the unit uses, the hit points, whether it has shields, etc etc. Some actions will require the unit to be respawned for the changes to appear.
This process can be repeated for things like weapon.dat to change damages, attack types, animations, etc.
Changing Displayed Info of unit: Open DatEdit, and proceed to "FileManager". On the list that appears, find a unit you would like to edit. I will be editing a zergling in this example.
Edit the name of the unit you would like to edit something such as this: ####################### This is to ensure that if we change the name of the unit, the "new" name is not longer than the old one. (Can cause centering issues)
Save your change, and go back to Trigger Editor. Now we will be using the "ChangeStarText" option in the EUD tab. Find your newly edited unit in the list:
The number can remain 0, but for the Text we will use a dynamic solution from above; We will also add an array to the name to pull the "guild rank" as shown in example.
tct.str(0x57EEEB + 36 * 0), tct.s2u(tct.strptr(CRanking[dwread_epd(0 * 12 + 0)])) <---A comma "," separates the 2 different functions. In this example, player 1 is the target.
We can go further by adding a secondary line under name to display additional info. In the below example I use it to display Remaining Lives. Open DatEdit and go to the "Advanced" tab of the unit you wish to edit. Select the "Detector" checkbox from the flags list. Go back to TriggerEditor and again create a new action using ChangeStarText.
This time we will select <3>Detector from the list instead of unit name. We can use a read-array function as described earlier to display our desired info. In this case I have simply attached it to player's custom score.
"\x1CRemaining Lives: \x04",dwread_epd(EPD(0x5822F4 + 4 * 0)), "\x14" <----Static text has quotes "" around it, functions do not. A comma , is needed to separate these.
Congrats, you now have a completely custom unit that pulls dynamic data from different sources to truly customize your unit.
Attachments:
Post has been edited 28 time(s), last time on Mar 1 2019, 1:36 am by MinuteMan.