Giter VIP home page Giter VIP logo

Comments (75)

 avatar commented on September 28, 2024 4
  • Legacy editor. Or just a better editor

Working on it!

EDIT: Leave your features requests & ideas for the editor here!

from starfallex.

 avatar commented on September 28, 2024 2

@thegrb93 I am writing an editor from scratch, implementing SF highlighting should be as easy as changing the generate_builtin property in the currently existing GLua 'Highlighter' from _G to SF.<table_with_functions_and_function_tables>.

EDIT: Early version of the format;

{
    "package_type": "highlighter",
    "package_name": "gLUA syntax-highlighting for Rocket",
    "package_author": "Arena",
    "package_version": "1.0.0",
    "tokenizer": {
        "def_modifiers":    false,
        "allow_tinker":     true,
        "generate_builtin": "_G",
        "patterns": {
            "[%d+%.*%d*]+":         "=digit",
            "[!~=%+%-%*/|&%%%^<>]+":   "=operator",
        },
        "tokens": {
            "function":         "=def_start",
            "(":                "=par_start =args_start =def_end >)",
            ")":                "=par_end =args_end",
            "local":            "=keyword",
            "if":               "=keyword >then",
            "for":              "=keyword >in",
            "while":            "=keyword >do",
            "in":               "=keyword >do",
            "then":             "=keyword >end",
            "do":               "=keyword >end",
            "else":             "=keyword |end",
            "elseif":           "=keyword |then",
            "end":              "=keyword",
            "[[":               "=multiline_start >]]",
            "]]":               "=multiline_end =comment_end",
            "--[[":             "=comment_start >]]",
            "--":               "=comment_line",
            "TODO":             "=comment-todo"
            "not":              "=operator",
            "and":              "=operator",
            "[":                "=indexer_start >]",
            "]":                "=indexer_end",
            "{":                "=collector_start >}",
            "}":                "=collector_end",
            "\"":               "=string_start =string_end >\"",
            "false":            "=boolean",
            "true":             "=boolean",
        },
        "split": {
            " ": 1,
            ",": 1,
            "(": 2,
            ")": 2
        }
    }
}

Where = assigns a word to a token, =*_start defines the start of a token area, =*_end defines the end of a token area, =*_line defines a token that takes up the remainder of the line and =*-... defines a token subclass (highlight overwrite can occur).

Furthermore, >, < and | respectively mean: "Scope up and wait for token X", "Scope down and wait for token X" and "Stay on this scope, but wait for token X".
This can be used for error-prevention, say "(" its scope was never closed by ")", the editor will notify the user (ideally with a small warning sign in the gutter that can be clicked).

There are currently no guidelines as to what token names to use, but I will set up some defaults as I get this working, so that single themes can work across multiple language packages.

EDIT: Progress! This is the tokenizer/colorizer almost done; just need some more polishing, bugfixing and stricter rules.

from starfallex.

suunr avatar suunr commented on September 28, 2024 1

Request Feature

halt(reason) function. It should stop the processor on client and server and print the reason. It would be a way better method to stop the chip instead of using error(). error() prints an ugly and long stacktrace, which isn't necessary.


Defining methods for built-in types, e.g.:

function Vector:setX(x)
    self.x = x
end

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024 1

Finally got some free time. I'll do all of the small tasks tonight. Going to play doom for a while first.

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024 1

I fixed it. Finally got around to finishing some of the tasks too. I had been working on redoing the pony mod which is now in another repository of mine.

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

Looks like the chip won't send code to clients until they enter the same pvs as the chip; will fix. Seems like the code is sent after the client enter's the pvs though. I need to refactor the networking anyway. Will fix the reliable channel overflow and this at the same time.

from starfallex.

suunr avatar suunr commented on September 28, 2024

e2 doesn't have prop limit. Why does starfall have one?

from starfallex.

suunr avatar suunr commented on September 28, 2024

Can't setParent holograms to player anymore

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

e2 does, but it defaults to -1. I can change starfall's default. Dunno if stuff should be allowed to parent to players. Maybe I can allow parenting to the owner. I know stuff in e2 can be parented to anyone but you see the typical uses of that. I'll go ahead and change it.

from starfallex.

suunr avatar suunr commented on September 28, 2024

You can do everything what you do with setParent without it too

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

Except parenting stays active after the chip is deleted.

from starfallex.

suunr avatar suunr commented on September 28, 2024

Don't always wrap an entity if you access it with wire.ports (takes up very much cpu).

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

I always use the input hook. Accessing wire.ports is infact slower. In order to speed it up, it needs to cache what you access and recache when the input is changed.

from starfallex.

suunr avatar suunr commented on September 28, 2024

I use input hook too, but it would be really simplier and faster if wire library would cache already by itself

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

Even if it did, it would still be slower than using the input hook and storing the result alone.

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

Going to be working on school stuff for another week. Might take a vacation afterwards but idk. Will still fix any immediately needed things.

from starfallex.

suunr avatar suunr commented on September 28, 2024

setName() function and let the writecell return something. zcpu checks for the return value of ENT:WriteCell and if it's false it thinks that it wrote to unavailable memory.

from starfallex.

suunr avatar suunr commented on September 28, 2024

bit.tohex()'s second parameter isn't optional (in docs it says Optional.).

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

No idea why they did wrapper functions for bit library. I'll take a look at just importing the glua bit functions.

Done.

from starfallex.

suunr avatar suunr commented on September 28, 2024

Clientside http configuration (sf_http_interval, sf_http_max_active concommands)

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

Would probably be better just to only allow the owner of sf to make the http requests. What do you think?

from starfallex.

suunr avatar suunr commented on September 28, 2024

Yeah, that would be really good too. Running on http requests on others can be pretty abused (also on server)

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

Tested and pushed update.

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

setName sets the name of the chip right?

from starfallex.

suunr avatar suunr commented on September 28, 2024

Yes

from starfallex.

suunr avatar suunr commented on September 28, 2024

Don't remove the props spawned by the starfall if you remove the chip

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

Done

from starfallex.

suunr avatar suunr commented on September 28, 2024

net.readTable and net.writeTable could be just serialized to von and then compressed

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

Yeah. Users can easily do that themselves so I guess there's no need for read/write table. It's better practice to avoid read/write table anyway.

from starfallex.

suunr avatar suunr commented on September 28, 2024

file.write always returns true

from starfallex.

 avatar commented on September 28, 2024

How about an equivalent of EA2's noFrameRefresh( boolean onOff )?
This basically doesn't clear the Screen RT every frame; or is am I overlooking something in the render functions?

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

Screen no longer uses an RT so it gets cleared anyway by the game itself. If you need it to not be cleared, you have to create an RT and use the RT.

I'll take a look at file.write

from starfallex.

 avatar commented on September 28, 2024

Implement IGModAudioChannel:SetTime and IGModAudioChannel:GetTime?

EDIT: I meant Time, the naming is quite confusing as BASS itself uses BASS_ChannelSetPosition and BASS_Set3DPosition.

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

Added that. When should file.write return false btw?

from starfallex.

 avatar commented on September 28, 2024

When should file.write return false btw?

According to this lua file, file.Write doesn't return anything by default, you could consider checking whether the file.write succeeded, e.g. return file.Exists( file, path ).

Or derive your own function from the code in there and have something like:

local f = file.Open( filename, "wb", "DATA" )
if not f then return false end

f:Write( contents )
f:Close()

return true

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

Alright, thanks.

from starfallex.

suunr avatar suunr commented on September 28, 2024
getClipboardText()
setClipboardText(string)

Only should work on owner's chip since it is very abusable.

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

I can't find those.

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

3rd party plugin maybe?

from starfallex.

suunr avatar suunr commented on September 28, 2024

http://wiki.garrysmod.com/page/Global/SetClipboardText
Well, thought there is some GetClipboardText, but there isnt.

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

Oh thought you were reporting it as a bug. I suppose I can add it.

from starfallex.

 avatar commented on September 28, 2024

If possible, could you add custom fold regions in the editor such as in C#?
Example:

--#region Helper functions
local function num2hex( n ) local h="0123456789abcdef" local s="" while n>0 do local m=math.fmod(n,16)  s=string.sub(h,m+1,m+1)..s n=math.floor(n/16) end if s=="" then return"0" end return s end
local function perf( pct ) return ( quotaUsed() < (quotaMax()/95)*pct ) end
--#endregion

The entire region here would be fold-able within the editor

This greatly improves code readability, especially considering most people write their SF chips all in one file.

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

This is how I do it.

local foo, foo2, foo3, foo4, foo5
do --Helper functions
    function foo()
    end
    etc...
end

from starfallex.

suunr avatar suunr commented on September 28, 2024

I just looked at the ace homepage and saw in the features:
Fully customizable key bindings including vim and Emacs modes
Can we have vim mode? 😮

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

Done I think. Let me know if it works, I have no idea how to use vim or emacs.

from starfallex.

suunr avatar suunr commented on September 28, 2024

Feature request

Add setCode(starfallEntitiy, string).
It should set the code of a starfall chip and resets everything of it (hooks, holograms, props, sounds, ...).

from starfallex.

suunr avatar suunr commented on September 28, 2024

Feature request

E2-like extension system. Easily enable and disable libraries without touching any lua.
Also E2-like Chip tracker. It should list all Starfalls placed and show their cpu (server, client) and their owner. It's important for admins since starfall chips are more dangerous than e2s.

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

I can add some optional parameters to error() to allow changes to its behavior. Also, shouldn't setX return the vector?

@ThatOneCheetah, are you writing an editor from scratch or basing it off another? I'd like to adapt one of gmod's already existing editors to sf, but if you're really up to such a huge task of making one from scratch then that's fine too. I can't help until next Wednesday when school is finally over.

from starfallex.

suunr avatar suunr commented on September 28, 2024

Ye, it should return a vector, but it's only an example

from starfallex.

suunr avatar suunr commented on September 28, 2024

I can add some optional parameters to error() to allow changes to its behavior.
Would be nice


Changing keybinding in editor does nothing.


@ThatOneCheetah , i suggest making a new issue for the editor where you can post the progress.

from starfallex.

suunr avatar suunr commented on September 28, 2024

The vim mode kinda works after i reconnected a server. But i can't insert or delete anything, i can only navigate.

from starfallex.

suunr avatar suunr commented on September 28, 2024

Feature request

Instead of Vector:set(vector2), implement Vector:clone(). Same with Angle.

from starfallex.

suunr avatar suunr commented on September 28, 2024

setX,Y,Z,etc.
SetX was just an example. I mean defining any method for built in types.

from starfallex.

suunr avatar suunr commented on September 28, 2024
--@client
print(Color(0, 0, 0))

produces the following error:

addons/starfallex/lua/starfall/libs_sh/color.lua:64: attempt to concatenate field 'a' (a nil value)
stack traceback:
    addons/starfallex/lua/starfall/libs_sh/color.lua:64: in function 'tostring'
    addons/starfallex/lua/starfall/libs_sh/builtins.lua:243: in function 'print'
    SF:main:4: in function 'func'
    addons/starfallex/lua/starfall/instance.lua:38: in function <addons/starfallex/lua/starfall/instance.lua:37>
    [C]: in function 'xpcall'
    addons/starfallex/lua/starfall/instance.lua:71: in function 'runWithOps'
    addons/starfallex/lua/starfall/instance.lua:134: in function 'initialize'
    addons/starfallex/lua/entities/starfall_processor/cl_init.lua:72: in function 'CodeSent'
    addons/starfallex/lua/entities/starfall_processor/cl_init.lua:92: in function 'func'
    lua/includes/extensions/net.lua:32: in function <lua/includes/extensions/net.lua:17>

from starfallex.

 avatar commented on September 28, 2024

@its-suun Fixed

from starfallex.

suunr avatar suunr commented on September 28, 2024

Feature request

enableErrorSending(bool) function on serverside. If you call it with true, every client which errored will send a net message to the server with the error. It can't be done in user apps yet, cause you would need to do try(...) everything, which isn't everywhere possible (e.g. hooks).

Example:

--@shared 

if SERVER then
    enableErrorSending(true)

    hook.add("net", "", function(name, len, ply)
        if name == "ClientError" then
            print(ply:getName() " errored:" .. net.readString())
        end
    end)
else
    ...
end

from starfallex.

suunr avatar suunr commented on September 28, 2024

Feature request

The --@include command shouldn't throw an error when the file isn't found. Instead it should throw an error when you require() it. This can be used to react when a library isn't found and then download it for example.

from starfallex.

 avatar commented on September 28, 2024

@its-suun this is expected behaviour, to circumvent this you can:

--@include <include>

try( function()
    require( "<include>" )
end, function() --[[ download stuff ]] end )

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

--@include is what's throwing the error so that wouldn't work. I can change this behavior.

from starfallex.

suunr avatar suunr commented on September 28, 2024

render.cursorPos doesn't work with a HUD.

from starfallex.

suunr avatar suunr commented on September 28, 2024

Feature request

Entity:setPhysProp(s), it should work like the Physical Properties tool.
Example:

chip():setPhysProp("Super Ice")

from starfallex.

suunr avatar suunr commented on September 28, 2024

Bug

There aren't any methods on color types.
Example:

Color(1, 2, 3, 4):hsvToRGB() -- error

from starfallex.

 avatar commented on September 28, 2024

-- error

@its-suun A stacktrace would help, as this is unexpected behaviour, as the color methods should just be working.

from starfallex.

suunr avatar suunr commented on September 28, 2024

Very useful stacktrace for a missing function

`SF:main:4: attempt to call method 'hsvToRGB' (a nil value)
stack traceback:
    SF:main:4: in function 'func'
    addons/starfallex/lua/starfall/instance.lua:38: in function <addons/starfallex/lua/starfall/instance.lua:37>
    [C]: in function 'xpcall'
    addons/starfallex/lua/starfall/instance.lua:71: in function 'runWithOps'
    addons/starfallex/lua/starfall/instance.lua:134: in function 'initialize'
    addons/starfallex/lua/entities/starfall_processor/cl_init.lua:72: in function 'CodeSent'
    addons/starfallex/lua/entities/starfall_processor/cl_init.lua:92: in function 'func'
    lua/includes/extensions/net.lua:32: in function <lua/includes/extensions/net.lua:17>

from starfallex.

Damianu avatar Damianu commented on September 28, 2024

setFPS(xx) on screen would be nice, so you can keep stable FPS on multiple clients.

from starfallex.

Damianu avatar Damianu commented on September 28, 2024

Ahh, also "Roboto" at render.CreateFont is missing(Or I am just blind, which I probbably am)

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

Probably is. I can add it.

from starfallex.

Damianu avatar Damianu commented on September 28, 2024

Wrong hook name at

hook.Add( "PlayerButtonUp", "SF_PlayerButtonDown", PlayerButtonUp)

from starfallex.

Damianu avatar Damianu commented on September 28, 2024

http://i.imgur.com/x2j8T4F.png Those 2 functions are in helper, but after compiling it says they dont exist.

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

Yeah.. I need to update the docs. I have lots of free time today so I can get some things done.

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

For setCode, can't you use globaltables or remote hook run with loadstring() so have that chip run whatever code?

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

Does anyone know how array IO works? I've been putting that one off forever since I don't know how exactly to do it. I'm thinking maybe just an SF.Sanatize

from starfallex.

suunr avatar suunr commented on September 28, 2024

Bug

Entity:setParent(x) doesn't check for nil.
Throws addons/starfallex/lua/starfall/permissions/providers_sv/cppi.lua:48: attempt to index local 'target' (a nil value) when x is nil

from starfallex.

suunr avatar suunr commented on September 28, 2024

Feature request

A way to ignite props

from starfallex.

thegrb93 avatar thegrb93 commented on September 28, 2024

Finished adding ignite, extinguish, setphysmaterial, and filter function for traces.
Moving to new issue thread.

from starfallex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.