Simplified E2asm (via E2-unknown) #1
Cheatoid
started this conversation in
Show and tell
Replies: 1 comment
-
Updated for the latest upstream changes, make sure to pull the latest version from the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This requires
E2-unknown
branch in order to work.Simplified E2asm makes running E2 code into fun experience. In terms of operation this resembles similar to how Lua C API works, by utilizing a stack and a basic set of functions/commands, you can run any E2 function at runtime.
It uses chat commands as interface and comes with 5 main commands (more commands can be added easily):
pushs
: Pushes a string onto the stack.pushn
: Pushes a number onto the stack (supports hexadecimal0x
and binary0b
notations).pop
: Pops at least one value from the stack (optionally, specify an integer for different amount).call
: Invokes the function via dynamic dispatch. This command has two optional arguments for specifying amount of arguments (defaults to0
) and a return typeid (defaults to empty string, akavoid
).dump
: Dumps/Displays the contents of stack.In case you are not familiar with such stack-based coding, here is an example for you to try, use chat to enter the following commands:
/pushs propSpawn
(the function you want to call)/pushs models/props_borealis/bluebarrel001.mdl
(the first argument)/pushn 0
(the second argument)/call 2
or/call 2 e
(pops two arguments, callingpropSpawn
, and either discard or save the result onto the stack)Beta Was this translation helpful? Give feedback.
All reactions