-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added: Pull request for "fsensor" and "contrtrol" dedicated control theory OOP #75
Conversation
…heory OOP Added: "fsensor" as a general environment sensor for obtaining process data Added: "contrtrol" for creating a OOP process variable controller that can me tuned using various methods
@thegrb93 FYI Tell me if you need some adjustments. The addon is updated to the latest version from my personal machine. It includes the all recent modifications. You can test it if you like 👍 |
Firstly get rid of all the concatenation in the e2 description file unless there's a really good reason for it. Should be a simple replace-all. Once I can actually read the functions' descriptions then I can review them. |
The idea is if something is gonna get changed in the future, it will be an update of only one value. This wiki is automatically generated from the description ;). Every OOP class has a dedicated table. The links are not stored in the description. Only the overhead text. FSensor: https://github.com/dvdvideo1234/ControlSystemsE2/wiki/FSensor |
Exported and replaced to ease you out fsensor_descr.txt and stcontrol_descr.txt. Using this method I can dynamically generate the documentation by adding overhead to the file and compiling it 💃 The line |
I'd say if you really needed to change anything, a find-replace-all would be just as easy. I'll look at your wiki page for now. My main concern is code bloat i.e. adding functions nobody will ever use and just get in the way, or functions that are just as easy to make inside e2 itself. I'll look tonight. |
@thegrb93 keep in mind that this is wire extras, where we don't need to care as much about bloat and such. Still care a little, just not as much as the normal wire repo |
Done. Just tell me how you like 'em ok ;) |
That looks better, flash sensor needs a new name though. I had no idea what it was until I read the wiki page. It's Trace structure basically, right? Just call it a Trace structure. |
Don't do manual collectgarbage()'s |
Gotta leave them to the game collector then. Is it ok for I want my repo and the wire code to be the same as the OOP related files are concerned. The description I can generate any time in any format, so it's not big of an issue ;) |
Removing the Edit: |
Basically, an OOP wich traces and retrieves trace result. Later you can read every aspect of this trace result. Kinda like ranger data, but not need to calculate positions directions, filters and all that stuff in every E2 tick to create a |
Get rid of outError and outPrint or make them singleplayer only. |
What I should replace them with ? print() / error() ? |
Either nothing or the core print function. |
How can I output an error then ? |
All E2 functions fail silently and/or return a zero equivalent value whenever there's an error. If you call the lua error function you shut down the entire chip, which is something that E2 tries to avoid. The print function seems fine, but pointless. You're using the standard lua print function, and since E2 runs serverside, the user of the E2 will never see those prints. So for example the |
Can I Leave the print statement then, to be intended for singleplayer? |
Look in the debug.lua for how e2 printing works https://github.com/wiremod/wire/blob/master/lua/entities/gmod_wire_expression2/core/debug.lua |
Depends on the type, it's whatever you think a good default is for the value. e.g. number = 0, string = "", entity = NULL Don't return something that isn't of the type Also I've noticed you make |
Thank you @thegrb93 @bigdogmat. I have to test how the different prints behave in my home machine because I want to be able to tell the user that something happened. |
Ok. I was able to replace every occurrence of |
Which of these will be better to replace the printing functions:
So far I'd like to use option (1.), but if the chip execution does not stop will be more likely has to be (3.), because the screen will be flooded with hint messages otherwise. What do you guys think ? |
Chatprint probably. |
Updated: CS E2 to the latest version
@thegrb93 -- sMsg > Message to be printed
-- oSelf > Self reference of the E2
-- nPos > Where to print the message ( HUD_% ). Defaults to chat
local function logStatus(sMsg, oSelf, nPos, ...)
if(varEnStatus:GetBool()) then
local nPos = tonumber(nPos) or gtPrintName[gsDefPrint]
local oPly, oEnt = oSelf.player, oSelf.entity
local sNam, sEID = oPly:Nick() , tostring(oEnt:EntIndex())
local sTxt = "E2{"..sEID.."}{"..sNam.."}:ftracer:"..tostring(sMsg)
oPly:PrintMessage(nPos, sTxt:sub(1, 200))
end; return ...
end |
2487396
to
e03e602
Compare
Ok. I'll look again |
I also updated the line endings to CR-LF ( Windows ) to match the other files |
…ad of `StController`
Updated the wiki accordingly: https://github.com/dvdvideo1234/ControlSystemsE2/wiki/FTrace |
3cc2797
to
b814469
Compare
@thegrb93 I will be able to tes it today and will show you the example code. Thanks ! |
Ok |
@thegrb93 Tested and updated with 2 bug fixes. You can find the sample code here: |
67d868e
to
a8296a9
Compare
Fixed: Array to key conversion not trimming spaces in method names
a8296a9
to
3876cc0
Compare
Hello, @thegrb93, the source is ready to be merged on my side ;) |
Added: "fsensor" as a general environment sensor for obtaining process data
Added: "contrtrol" for creating a OOP process variable controller that can me tuned using various methods
Based on: #59