Hello,
I think that a thread is actually posted for this subject but I want to know how I can create some E2 function. I've tried this:
[CODE]
e2function returntype functionname(type arg1, type arg2, ...)
--do stuff
end
[/CODE]
I've replaced returntype by string and I have an error: " @anonymous_4:7: '=' expected near 'string' ".
Could somebody help me please :buckteeth: ?
(Sorry if my english is bad :cat:)
You'll get better and faster responses on the Wiremod discord which you can find on the [URL="http://wiremod.com/"]Wiremod website[/URL]. For the sake of answering your question, that syntax is only valid after being ran through the extension loader, as it's not valid Lua. You'll want to put that into the custom extensions folder which is located at "wire/lua/entities/gmod_wire_expression2/core/custom".
Ok thank you ;)
[QUOTE=NathanS;52831142]Hello,
I think that a thread is actually posted for this subject but I want to know how I can create some E2 function. I've tried this:
[CODE]
e2function returntype functionname(type arg1, type arg2, ...)
--do stuff
end
[/CODE]
I've replaced returntype by string and I have an error: " @anonymous_4:7: '=' expected near 'string' ".
Could somebody help me please :buckteeth: ?
(Sorry if my english is bad :cat:)[/QUOTE]
In Lua you dont need to define the return type, so instead just do
[CODE]
function functionname(arg1, arg2, ...)
--do stuff
end
[/CODE]
Remember, in Lua you don't need to declare the type of a variable.
[QUOTE=0V3RR1D3;52835193]In Lua you dont need to define the return type, so instead just do
:snip:
Remember, in Lua you don't need to declare the type of a variable.[/QUOTE]
This isn't for Lua functions, Wiremod has an extension loader that gives a custom syntax for creating E2 functions. The loader converts the file to valid Lua.
[QUOTE=Ia_grib;52835462]Is that GLua anymore tho?[/QUOTE]
Aside from the function definitions everything is normal Lua
[QUOTE=bigdogmat;52835279]This isn't for Lua functions, Wiremod has an extension loader that gives a custom syntax for creating E2 functions. The loader converts the file to valid Lua.[/QUOTE]
I thought he was asking how to convert an E2 function to Lua, not the other way around.
Sorry, you need to Log In to post a reply to this thread.