[Added] Read text from arbitrary lumps from ZScript

Moderators: Developers, ZDoom.org Team

Re: Read text from arbitrary lumps from ZScript

Postby Gutawer » Sun Oct 29, 2017 10:45 am

Ah, my apologies, didn't see that.
User avatar
Gutawer
 
 
 
Joined: 16 Apr 2016
Discord: Gutawer#3431

Re: Read text from arbitrary lumps from ZScript

Postby The Zombie Killer » Sun Oct 29, 2017 11:09 am

_mental_ wrote:@The Zombie Killer
If you so inclined to work with binary data you can access character codes via String.CharCodeAt() function.
The engine doesn't do any interpretation of lump's data, so working with raw bytes is already doable.

This poses an issue when using ScriptCall to access this API via ACS though, due to the string being truncated at the null byte.
User avatar
The Zombie Killer
King of the Kangaroos
 
 
 
Joined: 14 Jul 2011
Location: Gold Coast, Queensland, Australia
Discord: Zombie#1795

Re: Read text from arbitrary lumps from ZScript

Postby _mental_ » Sun Oct 29, 2017 11:50 am

I would like to keep API as simple as possible. Please do all processing in ZScript and use ACS only when something cannot be done without it.
Do not forget that ultimate goal is to replace ACS with ZScript everywhere.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Read text from arbitrary lumps from ZScript

Postby Rachael » Sun Oct 29, 2017 12:06 pm

_mental_ wrote:Do not forget that ultimate goal is to replace ACS with ZScript everywhere.

I thought Graf specifically said something against this because it was "reinventing the wheel." - or at least that's what someone told me, on Discord.

At any rate, if it's really true I'd probably like to introduce a few ACS-specific functions to ZScript, myself.
User avatar
Rachael
Not all elves needs a stocking hat...
 
Joined: 13 Jan 2004

Re: Read text from arbitrary lumps from ZScript

Postby _mental_ » Sun Oct 29, 2017 12:18 pm

Well, I could get it wrong too.

But in any case providing reach API for handling lumps data is out of scope. Reading of packed structures, serialization, etc...
Sorry, it’s embedded scripting language, not generic purpose one like Python or Ruby.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Read text from arbitrary lumps from ZScript

Postby Major Cooke » Sun Oct 29, 2017 12:18 pm

Mostly everywhere. Naturally, map controls should be left to ACS such as level manipulation (scripts to raise/lower walls and all that good stuff).

...ninja'd. :mrgreen:
User avatar
Major Cooke
Slaughterer of Sewers
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: Read text from arbitrary lumps from ZScript

Postby Graf Zahl » Sun Oct 29, 2017 12:35 pm

Rachael wrote:At any rate, if it's really true I'd probably like to introduce a few ACS-specific functions to ZScript, myself.



Long term I think the entire ACS function set needs to be reviewed for ZScript inclusion and then refactored out of the ACS VM. Maybe the same for FraggleScript so that all 3 languages can access the same code and have an orthogonal feature set when it comes to high level map manipulation.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Read text from arbitrary lumps from ZScript

Postby Rachael » Sun Oct 29, 2017 12:57 pm

I think having a single VM for all of the languages could be beneficial in the long term, at least as far as code maintenance goes.

If it were up to me, I'd probably want to deprecate ACS and let it be nothing more than a means by which to run legacy projects - going forward, updating a singular interface with a singular language will be a huge boon for project authors, as well as the developers.
User avatar
Rachael
Not all elves needs a stocking hat...
 
Joined: 13 Jan 2004

Re: Read text from arbitrary lumps from ZScript

Postby Graf Zahl » Sun Oct 29, 2017 3:11 pm

Rachael wrote:I think having a single VM for all of the languages could be beneficial in the long term, at least as far as code maintenance goes.


Too much work. It'd mean translating ACS bytecode to ZScript bytecode which requires just as much code as interpreting it directly and touching the Fragglescript interpreter with all its fickleness is a no-go.

Rachael wrote:If it were up to me, I'd probably want to deprecate ACS and let it be nothing more than a means by which to run legacy projects - going forward, updating a singular interface with a singular language will be a huge boon for project authors, as well as the developers.


ZScript does not have latent functions which is a core concept of ACS, and unless that changes there's no chance. Writing a thinker to handle this is infinitely more complex.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Read text from arbitrary lumps from ZScript

Postby Edward-san » Sun Oct 29, 2017 3:24 pm

Regarding the lump reading interfering with the lump protection mechanism, I talked with the other devs at Zandronum (yeah, that's what I was referring) and yeah, we can move our mechanism to whitelist-based approach.

Though, in my personal opinion, making mandatory for such lumps to have a name like "ZLUMP_*" could be good?
Edward-san
Mathematics is the language with which God has written the universe. (Galilei)
 
Joined: 17 Oct 2009

Re: Read text from arbitrary lumps from ZScript

Postby gwHero » Sun Oct 29, 2017 6:09 pm

Now I do like ZScript and I definitely see the benefits of it, but I really don't understand why ACS is getting less appreciation these days.

For me the two can perfectly exist together; for main map and level control ACS is such a pleasant technique to work with, straightforward and powerful. I don't see how I could replace all my ACS with ZScript, not without much pain, if possible at all. I would not like to see it getting deprecated too soon.
User avatar
gwHero
Be your own Siddhartha
 
Joined: 08 May 2017
Location: The Netherlands

Re: Read text from arbitrary lumps from ZScript

Postby Rachael » Sun Oct 29, 2017 10:01 pm

gwHero wrote: but I really don't understand why ACS is getting less appreciation these days.

ACS allows an author to distribute closed-source. ZScript forces the source to be open.

ACS requires an external compiler to work with - whereas ZScript lumps can be edited directly with immediate effect.

ACS also requires everything to either in advance have a tag or on-the-fly reference in order to work with it - you cannot simply iterate all of a certain object in a level like you can with ZScript.

Those are my main gripes with it, really.
User avatar
Rachael
Not all elves needs a stocking hat...
 
Joined: 13 Jan 2004

Re: Read text from arbitrary lumps from ZScript

Postby The Zombie Killer » Mon Oct 30, 2017 12:00 am

gwHero wrote:Now I do like ZScript and I definitely see the benefits of it, but I really don't understand why ACS is getting less appreciation these days.

Agreed. Especially when we have tools like GDCC that allow us to straight-up use C in our mods.

Rachael wrote:ACS allows an author to distribute closed-source. ZScript forces the source to be open.

While it's nice to have everything open like that, I don't think it's necessarily a reason to discredit ACS. If someone doesn't want their source code public, they'll find a way to obfuscate it regardless.
I always thought encouraging an open source attitude is better than forcing it, anyway. Plus, the ACS bytecode format has allowed for various cool things like GDCC, and the stuff Kaiser did in the CIF series.

Rachael wrote:ACS requires an external compiler to work with - whereas ZScript lumps can be edited directly with immediate effect.

I never saw that as a real problem, plus a compiler can always be embedded, just like ZScript. Even then, I just have batch/shell scripts that automatically compile my scripts and run the game.

Rachael wrote:ACS also requires everything to either in advance have a tag or on-the-fly reference in order to work with it - you cannot simply iterate all of a certain object in a level like you can with ZScript.

That's caused by a lack of APIs to do so, if anything.
User avatar
The Zombie Killer
King of the Kangaroos
 
 
 
Joined: 14 Jul 2011
Location: Gold Coast, Queensland, Australia
Discord: Zombie#1795

Re: Read text from arbitrary lumps from ZScript

Postby Rachael » Mon Oct 30, 2017 12:11 am

I am not trying to argue whether ACS is good or not. I am merely responding to the apparent concern about what makes me react the way I do about it.
User avatar
Rachael
Not all elves needs a stocking hat...
 
Joined: 13 Jan 2004

Re: Read text from arbitrary lumps from ZScript

Postby The Zombie Killer » Mon Oct 30, 2017 12:14 am

Oh I'm aware, I was merely sharing my own stance on those things.
User avatar
The Zombie Killer
King of the Kangaroos
 
 
 
Joined: 14 Jul 2011
Location: Gold Coast, Queensland, Australia
Discord: Zombie#1795

PreviousNext

Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest