phu54321 / epscript Goto Github PK
View Code? Open in Web Editor NEWeudplib script
eudplib script
function afterTriggerExec() {
while(Bring(P1, AtLeast, 1, "Zerg Drone", "Anywhere")) {
MoveLocation("loc", "Zerg Drone", P1, "Anywhere");
RemoveUnitAt(1, "Zerg Drone", "loc", P1);
CreateUnit(1, "Zerg Mutalisk", "loc", P1);
}
}
/* __epspy__ makes 3 Triggers for 3 actions, 2 objects are wasted.
def afterTriggerExec():
if EUDWhile()(Bring(P1, AtLeast, 1, "Zerg Drone", "Anywhere")):
DoActions(MoveLocation("loc", "Zerg Drone", P1, "Anywhere"))
DoActions(RemoveUnitAt(1, "Zerg Drone", "loc", P1))
DoActions(CreateUnit(1, "Zerg Mutalisk", "loc", P1))
EUDEndWhile()
*/
It should use 1 DoActions in a series of actions for performance and map file size.
main.eps
import module;
function afterTriggerExec() {
module.a = 1;
module.main();
py_print(module.a, py_type(module.a));
}
module.eps
var a = 1;
function main() {
var b = 0;
a = b;
}
1 <class 'int'>
File "main.eps", line 5, in afterTriggerExec
module.main();
File "module.eps", line 5, in f_main
a = b;
TypeError: unsupported operand type(s) for <<: 'int' and 'EUDVariable'
It raises TypeError, but when module.main(); is called before module.a = 1;, the compile is successful and module.a is still an 'int', causing unexpected behavior.
import module;
function afterTriggerExec() {
module.main();
module.a = 1;
py_print(module.a, py_type(module.a));
}
1 <class 'int'>
[Stage 1/3] CollectObjects
- Collected 681 / 681 objects
[Stage 2/3] AllocObjects
- Preprocessed 681 / 681 objects
- Allocating objects..
[Stage 3/3] ConstructPayload
- Written 681 / 681 objects
Output scenario.chk : 0.909MB
Done!
Example code:
function f() {
return True;
}
example code:
import main
function afterTriggerExec()
{
const a = EUDArray(8);
a[0] *= 2;
a[1] /= 2;
}
/*
line 5, in afterTriggerExec
a[1] /= 2;
AttributeError: '_ARRW' object has no attribute '__ifloordiv__'
*/
In TriggerEditor of EUD Editor 2, P variable
is EUDArray with length 8. Action SetVariable
uses +=, -=, *=, /= for arithmetic.
Copied from phu54321/euddraft#14
function afterTriggerExec() {
var a;
if(a == 0) {
a++;
}
dbstr_print("lol"
dbstr_print("lol")
}
/*Saving to example.scx...
*[Stage 1/3] CollectObjects
* - Collected 2028 / 2028 objects
*[Stage 2/3] AllocObjects
* - Preprocessed 2028 / 2028 objects
* - Allocating objects..
*[Stage 3/3] ConstructPayload
* - Written 2028 / 2028 objects
*Output scenario.chk : 1.357MB
*Writing trace file to example.scx.epmap
*Done!
*/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.