Duke4.net Forums: M32 enhancement scripts - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

M32 enhancement scripts  "Various scripts to aid and speed up mapping"

User is offline   oasiz 

  • Dr. Effector

#1

I think it's about time I start a thread on this stuff. :) Goal is to add any helper scripts and whatnot as I progress and have time to share.
I've dabbled with these quite actively since 2016 when Hendricks did an initial "copy slope" script for Fury use.. From that I kind of learned the basics and then just realised how much the editor can be extended from stuff like missing hotkeys to all sorts of automation and previews. To me editing nowdays with scripts has allowed me to go far beyond what I'd normally do.

For to those new to m32 scripts, they are basically CON syntax text files that allow extension of the m32 editor to do things from automation to in-editor preview visuals and whatnot.
A good script is something you don't even notice is there and simply offers things like documentation and additional functionality that simply augments existing tools.
This means that no technical or programming knowledge beyond loading a script is really required from user's side and the rest.
A simple example could be something like you'd never even think about, such as setting tags for multiple sprites if you have more than one selected with the exact same stock dialogues and all.
There are a lot of already existing editor extensions that Allen added to Duke3D's build through "astub.c", which is responsible for things like the spinning nuke at the start, skill previews, lighting preview, etc..
Naturally this has been extended over the years in code by various authors, including TX and Helix, etc..
m32 merely moves the extension possibilities to work outside of source code changing and recompilations... Kind of like the whole ethos of eduke32 in the first place.


NOTE:
I'll try to keep this nice and clean, don't expect these scripts to cooperate extremely well together and these are not really enterprise-grade quality but they are generally adapted from stuff I've either tested on Fury or such.
My end goal is to create a scriptset similar to Fury but instead for Duke3D and other games.. When I have time :)


Sector 3D selection
Followed with some tips on how to work differently with ROR / TROR to the point where I no longer even bother separating SOS layers.


To load a script, place the file to d3d dir and run `include sectsel` inside console.
After that use SHIFT + SPACE for 3D selection.
QUOTE + X (lighting preview) is required to see selected sectors in 3D mode
EDIT: Selection bug with SE lights has been fixed on latest m32 (since july~ 25)

For workflow, I recommend watching the video.

Attached File(s)


11

User is offline   quakis 

#2

Since it's relevant I'll throw this tidbit here since it may also not be common knowledge.
If certain scripts are too useful on a day-to-day basis and they're compatible with each other, instead of typing in the console to include them every time you launch Mapster, try the following instead:

  • Create a new text file in the same folder as Mapster32
  • Call it m32_autoexec.cfg (make sure it's not saved as a .txt file)
  • Open the .cfg in a text editor such as Notepad or Notepad++.
  • Write in the console commands you would usually input on startup, for this example:
  • include sectsel
  • The script should now be included every time Mapster is launched.

You can add or remove from this at any time and is useful for other commands like forcing expertmode on launch, etc. Be careful about overdoing it though. I try to keep my autoexec minimal and only have this script included because I pretty much use it all the time. Just be aware of potential conflicts between scripts since you may need to exclude one script to make proper use of another.

View Postoasiz, on 08 July 2023 - 04:53 AM, said:

Sector 3D selection

I've said it once and I'll say it again, thank you for this script, it has been a day and night difference in my workflow in Mapster. Not only does it make complex TROR easier to manage without hoping that 2D mode behaves (even while using the CTRL + R method), but it also simply functions as a major quality of life improvement for selecting sectors full stop while in 3D mode. Less hassle, more getting things done. I've been so used to a similar feature using the variant Doombuilder editors over the years so to finally have it as a function while Duke mapping has been an absolute blessing. Sometimes the simplest things go a long way.
6

User is offline   Forge 

  • Speaker of the Outhouse

#3

View Postoasiz, on 08 July 2023 - 04:53 AM, said:

I think it's about time I start a thread on this stuff. :)

nice.
now i'm going to complain that i wished you'd dropped this about 6 months ago.

also: pin this thread

This post has been edited by Forge: 08 July 2023 - 08:08 AM

0

User is offline   oasiz 

  • Dr. Effector

#4

Thanks :)
While I added sector selection late 2022, the CTRL ALT R greyout removal is a new addition from a few weeks ago (I requested this to test how it'd look like and it worked out really well!)

I plan on having more scripts later on but I think it's going to rely a lot on users to combine them together.
IIRC appendevent is missing on m32 but I might be wrong.
0

User is offline   oasiz 

  • Dr. Effector

#5

Might be worth linking this too, tutorial I did about a year ago on m32 scripting basics to those who want to experiment:

3

User is offline   brullov 

  • Senior Artist at TGK

#6

Some features I'd like to request:

- Ability to hide/unhide all sprites in 3D mode;
- Give lotag/hitag to the group of selected sprites, sectors, or walls;
- Ability to enter the exact angle rotation when rotating sectors/sprites.
0

User is offline   Aleks 

#7

View Postbrullov, on 10 July 2023 - 02:33 AM, said:

- Ability to enter the exact angle rotation when rotating sectors/sprites.

For single sprites, you can input the exact rotation in F8 menu and for selected sectors, Alt+< allows you to input the value. Unless you only mean rotating with LShift+RMB, then yeah would be useful :P
0

#8

View Postbrullov, on 10 July 2023 - 02:33 AM, said:

- Give lotag/hitag to the group of selected sprites, sectors, or walls;


This is a single command:

do for i selsprites { set sprite[i].lotag 0 }

Replace 0 with whatever lotag you want. Replace lotag with whatever member of their struct you want to change, could be hitag, ang, extra, whatever. I used this most heavily on sectnum to affect when sprites would draw. It should be easy to apply this command to walls and sectors instead, as they're basically the same and you just replace 'sprite' with wall.

It would have been nice to bind it to a key and request an input, but after you've used it once already, you can recall it DOSKey style in the console anyway (press up) and it's about as fast.
0

User is offline   oasiz 

  • Dr. Effector

#9

Also there is copypaste to console now, making your life a lot easier with a collection of scripts, such as above!

FYI, I've been abusing statnum a lot with offsets lately, I'm not sure how to expose offsets easily on script side but with this you can layer say.. 5 sprites at the exact same x/y/z and have it always draw in correct order.
If you combine this with offsets then you can create rudimentary signs with smallfont text and it will just never glitch in classic/polymost.
Such a tutorial will be better fit on a separate thread I guess.. I still end up using console as F8'ing stuff without instant visual feedback is hell.
0

User is offline   brullov 

  • Senior Artist at TGK

#10

I'm mostly fine using scripts and commands, but it's a big hell no for newcomers. It looks like a hard thing to do, so why not bind a key to this action? The same goes with copy/pasting slopes. I would also create a template for effects like door or train delay effects.

This post has been edited by brullov: 11 July 2023 - 02:46 AM

0

User is offline   oasiz 

  • Dr. Effector

#11

When I have time...

Meanwhile all I have is this unfinished "megascript"

Attached File(s)

  • Attached File  d3d.zip (19.99K)
    Number of downloads: 258

1

User is offline   oasiz 

  • Dr. Effector

#12

I decided to just push the megascript stuff here for now:
https://github.com/oasiz-/m32script

It's not 100% complete yet but has things like the sector/sprite selection built-in, along with documentation.
Some bugs still exist like ,. being stolen in 2d or 3d modes but ideas/suggestions are welcome..

Basically this is a full rewrite of the SW scriptset and combines some things I wanted for Fury as well.
Nowhere near the most ideal code but a lot of dirty hacks are due to m32 script limitations.

This should run a bit faster than the one linked 2 years back since I use some better drawing functions.

I'll do a full feature run-through later on but you can apply a lot of the sw/fury stuff here.

Goal is to have an endgame script that integrates fully with duke stuff and is also extensible
5

User is offline   oasiz 

  • Dr. Effector

#13

I'll just document some more here quickly just in case anyone was curious enough and got stuck

Key features:
- <TAB> reads a lot more values than before! These can be pasted with various hotkeys to sprites, walls and sector surfaces.
- In-editor documentation for pretty much all SE sprites. <N> will display additional tooltip detail in most scenarios with effects and such. Sector tags and other quirks are on the to-do list.
- 3D selection for sectors/sprites (only either-or due to engine limitations)
- Things like tagging/rotation work on selected sprites, no more one-by-one
- Due to hijacking existing keys, a lot of functions had to be "rewritten" as a duplicate, some bugs or slight unintentional changes to the original behavior will exist as they get ironed out
- Loads of new helper keys for the editor for existing features or some new ones, many of these are displayed if a modifier is held. Some of the info is WIP and inaccurate.

<Num5> on it's own will match x-y on repeats against xrepeat, the closest 1:1 aspect on texture.

<SHIFT> +
W                   SLOPING                 Invert the slope value for pointed sector/sprite
Y                   PASTE TOOLS             Pastes the slope value to sector/sprite
U                   Z ADJUST                Raises the object by 1 unit
J                   Z ADJUST                Lowers the object by 1 unit
,                   ANGLE                   Increase angle by 1
.                   ANGLE                   Decrease angle by 1
NumPlus             SPRITE.EXTRA            Increase the extra of sprite(s) by 1
NumMinus            SPRITE.EXTRA            Decrease the extra of sprite(s) by 1
SPACEBAR            SELECTION               Select/Deselect sectors/sprites in 3D mode
PgUp                Z ADJUST                Raise sector selection (floor/ceiling/sprites) by 1024
PgDown              Z ADJUST                Lower sector selection (floor/ceiling/sprites) by 1024
END + PgUp          Z ADJUST                Raise sector selection (floor/ceiling/sprites) by 512
END + PgDown        Z ADJUST                Lower sector selection (floor/ceiling/sprites) by 512
HOME + PgUp         Z ADJUST                Raise sector selection (floor/ceiling/sprites) by 256
HOME + PgDown       Z ADJUST                Lower sector selection (floor/ceiling/sprites) by 256
Num6                SPRITE-REPEAT           Increase X-repeat of selected sprites
Num4                SPRITE-REPEAT           Decrease X-repeat of selected sprites
Num8                SPRITE-REPEAT           Increase Y-repeat of selected sprites
Num2                SPRITE-REPEAT           Decrease Y-repeat of selected sprites

<CTRL> +
W                   PASTE TOOLS             Paste picnum on pointed surface
Y                   PASTE TOOLS             Paste shade on pointed surface
NumPlus             SPRITE.HITAG            Increase the hitag of sprite(s) by 1
NumMinus            SPRITE.HITAG            Decrease the hitag of sprite(s) by 1
U                   SLOPING                 "Slaps" sprite to a ceiling (match sloping & Z)
J                   SLOPING                 "Slaps" sprite to a floor (match sloping & Z)
C                   GENERIC                 Usually corrects a sprite according to best practices
D                   GENERIC                 Drop a clone of selected/pointed sprite(s)

<ALT> +
Y                   PASTE TOOLS             Paste palette on pointed surface
U                   Z ADJUST                Rounds object(s) to closest 1024 (PgUp/Dn Height)
J                   Z ADJUST                Rounds object(s) to closest 128 (Like Mouse Z drag)
NumPlus             SPRITE.LOTAG            Increase the lotag of sprite(s) by 1
NumMinus            SPRITE.LOTAG            Decrease the lotag of sprite(s) by 1
-- Note: Beyond usual "ALT + H T M", these now apply to all selections automatically!
-- xvel/yvel/zvel/pal/shade (cstat pending) have been added as well as following:
H                   .HITAG
T                   .LOTAG
M                   .EXTRA
X                   .XVEL
Y                   .YVEL
Z                   .ZVEL
P                   .PAL
S                   .SHADE

<SHIFT> + <CTRL>
W                   PASTE TOOLS             Paste Z (height) on pointed surface
U     <deprecated!> SLOPING                 "Slaps" sprite to a ceiling (match sloping & Z)
J     <deprecated!> SLOPING                 "Slaps" sprite to a floor (match sloping & Z)

<CTRL> + <ALT>
D                   PASTE TOOLS             Paste x-panning on pointed surface
Y                   PASTE TOOLS             Paste y-panning on pointed surface
U     <deprecated!> Z ADJUST                Raise sector selection (floor/ceiling/sprites) by 1024
J     <deprecated!> Z ADJUST                Lower sector selection (floor/ceiling/sprites) by 1024


Since it's 2025, I'll try to get some stupid 5 second GIFs with overlay text or something to demo things later.
2

User is offline   Nacho 

#14

That slap sprite to ceiling/floor to match the slop has so much time saving potential.
0

#15

Hey Oasis, I added your mega scripts but I cant get it to work.

I have

include sectsel
include d3d

Included in my m32_autoexec.cfg file.
When I try the shortcuts described in your post above they do nothing.

I downloaded from here https://github.com/oasiz-/m32script

sectsel works but I cant get anything sutch as shift + Y to work.

Is there something I need to do? Thanks!

This post has been edited by William Gee: 06 January 2026 - 09:19 PM

0

User is offline   oasiz 

  • Dr. Effector

#16

Hey,

Only now saw this message!
I've updated the file, this was my bad as I was testing some editor source level changes which weren't needed after all!

Sectsel shouldn't be needed with d3d loaded in.
0

#17

Awsome! Thanks its working nicely!
Secsel shortcuts don't work though so I guess I still need it.
0

User is offline   oasiz 

  • Dr. Effector

#18

secsel? Sector selection? Enable light preview with ' X and then shift + space in 3D mode.
Remember that due to engine limits you can ONLY have either walls&sprites OR sectors selected at a time!
1

#19

Thanks! I was only using spacebar, not shift + spacebar.
1

User is offline   pepsodent 

#20

are more updates to the scriptset planned or is it done for now? There's some unfinished things and issues I noticed when quickly testing it as well as some possible new features I'd like to see.

First is the documentation. Its only for Sector Effectors, I'd like to see it for other special sprites and all tiles that have some unique code to them, like enemies and props etc

Second issue is the tiny font. The documentation menu at top left is too hard to read for me with that tiny font, its a issue I have with mapster as a whole. I thought there was no additional notes to effectors because I mistaken the N for an X and almost included that as another complaint I had with the scriptset...

Third issue I have is with texture panning. Its now set to ALT+numpad instead of Shift I was used to, is there a reason why? I noticed this little problem in your other scripts, for Fury and Shadow Warrior. Its not a big deal, just need to adjust to it but its been bugging me for a while why its like that.

Thats it for the issues but there's one thing I'd like to be added. How about a quick and easy, if there any free keys left, button combo for changing palette of selected thing forward and backward? I wanted that feature ever since I got into mapping.The current system of typing the number is a bit clunky and I always waste some time on it guessing the correct pal I need.

The script is amazing and all current features will be very helpful and timesaving in the long run, thank you very much for that.

This post has been edited by pepsodent: 28 February 2026 - 04:27 PM

0

User is offline   oasiz 

  • Dr. Effector

#21

View Postpepsodent, on 28 February 2026 - 04:03 PM, said:

are more updates to the scriptset planned or is it done for now? There's some unfinished things and issues I noticed when quickly testing it as well as some possible new features I'd like to see.

First is the documentation. Its only for Sector Effectors, I'd like to see it for other special sprites and all tiles that have some unique code to them, like enemies and props etc

Second issue is the tiny font. The documentation menu at top left is too hard to read for me with that tiny font, its a issue I have with mapster as a whole. I thought there was no additional notes to effectors because I mistaken the N for an X and almost included that as another complaint I had with the scriptset...

Third issue I have is with texture panning. Its now set to ALT+numpad instead of Shift I was used to, is there a reason why? I noticed this little problem in your other scripts, for Fury and Shadow Warrior. Its not a big deal, just need to adjust to it but its been bugging me for a while why its like that.

Thats it for the issues but there's one thing I'd like to be added. How about a quick and easy, if there any free keys left, button combo for changing palette of selected thing forward and backward? I wanted that feature ever since I got into mapping.The current system of typing the number is a bit clunky and I always waste some time on it guessing the correct pal I need.

The script is amazing and all current features will be very helpful and timesaving in the long run, thank you very much for that.


Hi, thanks!
Very much intend to work on this more..
There are also some bugs related to selection which I think are related to having the 2d/3d popup open or not.
Just been very busy with other projects taking priority but having feedback definitely helps with focusing more!

- Documentation, this is only for SE right now, I will want to improve and add more. How I've set it up currently allows me to use external game-specific files to expand on this.
At the moment I have no wall/sector stuff ready yet for this .. You can check the shadow warrior one to see what I've done there.

- Sorry! can't do much on that... It uses build's "printext" functions which operate on a fixed font size. I have no control over font :(
Technically it is possible to do this with sprite text but I think it might be prohibitively expensive/slow.. I could give it a try.
I think editor side has no "gametext" variant like CON does so it would be very much manual and intensive operations.
An argument could be made that the 8x8 font could be a little bit cleaner looking (i.e. thinner).

- Texture panning, I think I can fix this no problem. It probably breaks since I read SHIFT's status and it should not override it with how I currently do it but computers are shit and stuff.

- Palette cycling is definitely possible and I think there are still plenty keys left. Before I add a lot, I kind of want to see where to add these and maybe re-order some hotkey as well.
Many of these stem from Ion fury dev and the ever-expanding roster, which means that there might be fragmentation between functions.
i.e. slope related actions might be behind ALT and SHIFT modifiers.
I think there was a hotkey that TX added for the texture selector for this, FYI!
0

User is offline   pepsodent 

#22

View Postoasiz, on 28 February 2026 - 10:49 PM, said:

I think there was a hotkey that TX added for the texture selector for this, FYI!

sorry I have trouble understanding this one, what hotkey, for what? For palette change? In tile selector mode too, I frequently visit the wiki page on controls and dont see anything interesting there, unless its undocumented.


Good to hear that you are still interested in expanding the scriptset. I'll be looking forward for more helpful changes. Is it possible to have some new drawing tools, for better on grid circles for example?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options