Staredit Network > Forums > SC1 Mapping Tools > Topic: euddraft
euddraft
Jun 11 2016, 6:15 pm
By: trgk  

Jun 11 2016, 6:15 pm trgk Post #1



euddraft : Framework for creating & applying various plugins to a map.

This tool uses EUDA. Map using this tool will require EUD Enabler too work.

Download Github


This is simple plugin to repeatedly apply eudplib plugins to map. These plugins are included out of box:

- datadumper : Dump file content to SC memory and put its address to somewhere.
- grpinjector : Upload GRP(SC Graphics) data to memory and link it to somewhere.
- keepSTR : Make STR section un-freeable. The memory will live even after game is finished.
- noAirCollision : Air unit won't collide and repel each other.
- scmloader : Give more priority to map MPQ than that of SC mpqs.
- soundStopper : Stop specific sound.
- unlimiter : Remove bullet/sprite/image count limit.





Basic usage

1. Create setting file. Extension should be .eds/.edd
eds : Compile once. edd : Compile every time when any of the file changes.

Code
[main]
input : Path to input map
output : Path to output map

[plugin1]
# Arguments
key1 : value1
key2 : value2

[plugin2]
# Plugin may have no arguments

[plugin3]



2. Run setting file to euddrafts.

Code
> euddraft.exe [setting]


You can set file associations to speed up the process.


3. All finished. You'll see nothing if it succeeds, and see some error message if it fails. Fix error accordingly.




These are basic usage of included plugins.

Code
[dataDumper]
# myiscript.bin will be dumped to somewhere, and the dumped address should be stored at 0x6D1200.
myiscript.bin : 0x6D1200


[grpInjector]
# Same as dataDumper, except it includes special processing for starcraft GRP.
mygrp.grp : 0x58A364


[keepSTR]
# Normally you won't want to use this.
# Make STR section unfreeable. Every data from dataDumper or grpInjector goes to STR section,
# so If you want them to live up even after game ends, this might help.


[noAirCollision]
# Air unit won't repel each other if you use this.


[scmloader]
# Prioritize map mpq than SC mpq. Only effects data loaded after first trigger loop such as
# unit sounds, portraits, or game dialogs.


[soundStopper]
# Add function to stop certain sound.
# ex) stopSound("staredit\\wav\\bgm.wav")
# You'll need to use inline_eudplib to use this function.

[unlimiter]
# Free bullets/sprite/image count limits.





EUD

Jun 11 2016, 6:28 pm trgk Post #2



Custom plugins

- You can create euddraft-wide plugins by putting plugin file to euddraft\plugins folder.
:::: Import plugin with [pluginName]

- Or, you can place your plugin file to the folder where your setting file is stored.
:::: Import plugin with [pluginPath.py]. Check the py extension.



Plugin may define 3 functions. Example function utilizes only afterTriggerExec.

- onPluginStart : Run once before map's first trigger loop, before beforeTriggerExec.
- beforeTriggerExec : Run before every trigger loop
- afterTriggerExec : Run after every trigger loop

Or, you can register custom function to euddraft namespace using @EUDRegistered directive. See default soundstopper plugin for more details.
Registered function can be used inside normal triggers via inline_eudplib.

.. note:: inline_eudplib is TrigEditPlus exclusive directive. Classic text trigger editor won't read them and will destroy it.
:::: They are compatiable with classic triggers however. It is hidden there.






Example plugin:
from eudplib import *


@EUDFunc
def ApplyHallucinatedFlag(unitepd):
# /*0x0DC*/ u32 statusFlags;
# 0x40000000 : Hallucination
origStatusFlags = f_dwread_epd(unitepd + (0xDC // 4))
f_dwwrite_epd(unitepd + (0xDC // 4), origStatusFlags | 0x40000000)


def afterTriggerExec():
for ptr, epd in EUDLoopUnit():
# /*0x118*/ u8 irradiateTimer;
# /*0x119*/ u8 stasisTimer;
# /*0x11A*/ u8 plagueTimer;
# /*0x11B*/ u8 stormTimer;
timers = f_dwread_epd(epd + (0x118 // 4))
timers = f_dwbreak(timers)
stasis = timers[3]

# If unit is frozen, then unfreeze it and apply hallucination
if EUDIf()(stasis >= 2):
# Set stasisTimer to 1. As SC sets it to 0, SC will do some
# complex unfreezing processes.
new_timers = timers[0] * 65536 + 1 * 256 + timers[2]
f_dwwrite_epd(epd + (0x118 // 4), new_timers)

# Apply hallucination to unit and its subunits.
ApplyHallucinatedFlag(epd)
# /*0x070*/ BW::CUnit* subUnit;
for su_ptr, su_epd in EUDLoopList(ptr + 0x70):
ApplyHallucinatedFlag(su_epd)
EUDEndIf()

DoActions(SetMemory(0x6509A0, SetTo, 0)) # EUD turbo trigger


Post has been edited 1 time(s), last time on Jun 11 2016, 7:10 pm by trgk.



EUD

Jun 11 2016, 6:38 pm LoveLess Post #3

Let me show you how to hump without making love.

Yeah I have seen unlimiter before:







None.

Jun 11 2016, 6:48 pm trgk Post #4



For plugin creators:

Supported functions


Basic syntax


Post has been edited 4 time(s), last time on Jun 11 2016, 7:09 pm by trgk.



EUD

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[2024-4-17. : 1:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
[2024-4-17. : 1:52 am]
Vrael -- hah do you think I was born yesterday?
[2024-4-17. : 1:08 am]
O)FaRTy1billion[MM] -- i'll trade you mineral counts
[2024-4-16. : 5:05 pm]
Vrael -- Its simple, just send all minerals to Vrael until you have 0 minerals then your account is gone
[2024-4-16. : 4:31 pm]
Zoan -- where's the option to delete my account
[2024-4-16. : 4:30 pm]
Zoan -- goodbye forever
Please log in to shout.


Members Online: lil-Inferno, Ultraviolet