![]() |
|
Can't we call Starfall code from HTML? - Printable Version +- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk) +-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html) +--- Forum: Starfall (https://teamscm.co.uk/forum-7.html) +--- Thread: Can't we call Starfall code from HTML? (/thread-2691.html) |
Can't we call Starfall code from HTML? - Skeleton - 05-05-2018 Hello, As the title says, can't we call Starfall code from HTML elements as we can do in standard gmod Lua? If no, could this be added? It would be useful to make nicer UI. Thank you. RE: Can't we call Starfall code from HTML? - Blackhawk - 05-05-2018 I really don't see the point in using HTML to make an UI. Making a "nice" UI with HTML takes probably far more time than just doing it in Starfall. Also HTML isn't really made for calling lua functions, you'd either use PHP or JavaScript. RE: Can't we call Starfall code from HTML? - Skeleton - 06-05-2018 Hey, Thank you for your answer but I don't think you get what I meant. In gmod Lua we can hook events from a HTML page to some actions like running some Lua code. Also it is already using Javascript to run Lua code, I think the best way for you to understand is to take a look at this. I don't know what is your knowledge in HTML and CSS but we can do really advanced stuff in only few lines and in a way probably more optimized that what we can currently do. We can also animate, transform (to fake a 3D effect for instance) and many other things. There is a reason why CEF used in a lot of games. Even the game's menu is a web page. RE: Can't we call Starfall code from HTML? - Person8880 - 06-05-2018 I'm guessing you tried to use the RUNLUA hack that Garry uses a lot, which won't work. Use this instead, which does. Also, I wouldn't trust the browser currently in the game. It's super outdated and doesn't support many of the now standard features of CSS3 and ES6. Perhaps when the CEF branch is finally brought into the standard release it may be more viable (if you enjoy the pain of web technologies), but for now I wouldn't get your hopes up. RE: Can't we call Starfall code from HTML? - Skeleton - 06-05-2018 Thank you. This function should do the trick. I'll take a look at the possibilities as I try to experiment stuff with Starfall (for instance the Trivia game I did). But yeah, when the CEF is out of the dev branch that will be alot better. As I'm thinking about making Derma stuff in Starfall I wanted to try HTML but yeah, it will probably be outdated as hell. |