View previous topic :: View next topic |
Author |
Message |
Body-Guard Unstoppable!
Joined: 08 Jan 2006 Location: Hungary
|
Posted: Wed Jan 07, 2015 12:14 pm Post subject: [ACS] Script scope addition for arrays |
|
|
ZDoom recently implemented script scoping for arrays: http://zdoom.org/wiki/Arrays
Before that, only map, global or world scope was available when defining them. I would be really happy to see it implemented here as well |
|
Back to top |
|
|
ZeroDev has entered the game!
Joined: 24 Sep 2012
|
Posted: Sat May 29, 2021 4:36 pm Post subject: |
|
|
I'm interested in that aswell. |
|
Back to top |
|
|
UberGewei SuperAntler
Joined: 01 Sep 2010 Location: The Netherlands
|
Posted: Thu Jun 03, 2021 11:25 am Post subject: |
|
|
What would the overall advantage be over map, global or world scope arrays.
Perhaps you could provide us with a use case?
It worries me slightly though.. given that multiple scripts can be executed in quick succession (depending on what and/or who is invoking it by what action),
the addition of arrays in a script-scope would imply it has the potential of becoming ludicrously heavy. ZDoom has no C/S environment, so that's nothing for them to worry about. |
|
Back to top |
|
|
Body-Guard Unstoppable!
Joined: 08 Jan 2006 Location: Hungary
|
Posted: Sun Jul 04, 2021 3:25 pm Post subject: |
|
|
UberGewei wrote: | What would the overall advantage be over map, global or world scope arrays.
Perhaps you could provide us with a use case?
...
the addition of arrays in a script-scope would imply it has the potential of becoming ludicrously heavy... |
I think the advantage is the same as having a more fine tuned scoping in any other programming language, that is, offering a way to better organize one's code. ACS is heavily function-based, so script scoping could be valuable in that regard. I don't know the engine's internal workings performance wise, though I suspect a one or two dimensional string array sized sanely should not really cause problems in any environment using modern hardware. If a script gets heavy, that is probably poor scripting on the ACS coder's part |
|
Back to top |
|
|
|