M32 script commands: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
M32-script command reference.
 
minor edit
Line 7: Line 7:
  '''i''': sets current sprite, '''s''': only sets current sprite by pointer<br>
  '''i''': sets current sprite, '''s''': only sets current sprite by pointer<br>
  '''D''': differs from CON, '''X''': deprecated/do not use (yet)<br>
  '''D''': differs from CON, '''X''': deprecated/do not use (yet)<br>
  '''''var/array/special''''': must be writable, (''something''): optional command field
  '''''var/array/special''''': must be writable, [''something'']: optional command field
====basic commands====
====basic commands====
*[[Nullop]]
*[[Nullop]]
Line 14: Line 14:
*[[Defstate]] (only for defining)
*[[Defstate]] (only for defining)
*[[Ends]]
*[[Ends]]
*[[State]] (only for calling)
*[[State]] '''D''' (only for calling)
*[[Onevent]]
*[[Onevent]]
*[[Endevent]]
*[[Endevent]]
Line 59: Line 59:
*[[Orvar]]
*[[Orvar]]
*[[Xorvar]]
*[[Xorvar]]
*[[Shiftvarl]]
*[[Shiftvarl]] (short: '''shiftl''')
*[[Shiftvarr]]
*[[Shiftvarr]] (short: '''shiftr''')


====varvar commands====
====varvar commands====
*[[Randvarvar]]
*[[Randvarvar]]
*[[Displayrandvarvar]]
*[[Displayrandvarvar]] (different from '''displayrand''')
*[[Setvarvar]]
*[[Setvarvar]]
*[[Addvarvar]]
*[[Addvarvar]]
Line 81: Line 81:
*[[Inv]] ''var''
*[[Inv]] ''var''
*[[Sqrt]] ''invar'' '''''outvar'''''
*[[Sqrt]] ''invar'' '''''outvar'''''
*[[Mulscale]] ''factor1'' ''factor2'' ''rshiftamount'''
*[[Mulscale]] ''factor1'' ''factor2'' ''rshiftamount''
*[[Dist]] '''''res''''' ''sprite1'' ''sprite2''
*[[Dist]] '''''res''''' ''sprite1'' ''sprite2''
*[[Ldist]] '''''res''''' ''sprite1'' ''sprite2''
*[[Ldist]] '''''res''''' ''sprite1'' ''sprite2''
Line 88: Line 88:


====special commands====
====special commands====
*[[Sort]] '''''array''''' ''count'' (''comparison_state'')
*[[Sort]] '''''array''''' ''count'' [''comparison_state'']
*[[For]] '''''itervar''''' ''what'' (''what2'')
*[[For]] '''''itervar''''' ''what'' [''what2'']
valid iteration types (''what''):  
valid iteration types (''what''):  
*allsprites '''i''', allsectors, allwalls, selsprites '''i''', selsectors, selwalls, drawnsprites '''s'''
*allsprites '''i''', allsectors, allwalls, selsprites '''i''', selsectors, selwalls, drawnsprites '''s'''
Line 156: Line 156:
*[[Canseespr]] ''sprite1'' ''sprite2'' '''''result'''''
*[[Canseespr]] ''sprite1'' ''sprite2'' '''''result'''''
*[[Neartag]] ''x'' ''y'' ''z'' ''sectnum'' ''ang'' '''''neartagsectorvar''''' '''''neartagwallvar''''' '''''neartagspritevar''''' '''''neartaghitdistvar''''' ''neartagrange'' ''tagsearch''
*[[Neartag]] ''x'' ''y'' ''z'' ''sectnum'' ''ang'' '''''neartagsectorvar''''' '''''neartagwallvar''''' '''''neartagspritevar''''' '''''neartaghitdistvar''''' ''neartagrange'' ''tagsearch''
*[[Rotatepoint]] ''xpivot'' ''ypivot'' ''x'' ''y'' ''daang'' '''''x2''''' '''''y2'''''
*[[Rotatepoint]] ''xpivot'' ''ypivot'' ''x'' ''y'' ''daang'' '''''xres''''' '''''yres'''''
*[[Dragpoint]] ''wallnum'' ''newx'' ''newy''
*[[Dragpoint]] ''wallnum'' ''newx'' ''newy''
*[[Getceilzofslope]] ''sectnum'' ''x'' ''y'' '''''resz'''''
*[[Getceilzofslope]] ''sectnum'' ''x'' ''y'' '''''resz'''''
Line 180: Line 180:


====quote commands====
====quote commands====
*[[Definequote]] ''quotenum'' (text...) | (static)
*[[Definequote]] ''quotenum'' [text...] | (static)
*[[Redefinequote]] ''quotenum'' (text...) | (dynamic)
*[[Redefinequote]] ''quotenum'' [text...] | (dynamic)
*[[Quote]] ''quotenum''
*[[Quote]] ''quotenum''
*[[Error]] ''quotenum''
*[[Error]] ''quotenum''
Line 190: Line 190:
*[[Getnumber16]] '''''var''''' ''quotenum'' ''max''
*[[Getnumber16]] '''''var''''' ''quotenum'' ''max''
*[[Getnumber256]] '''''var''''' ''quotenum'' ''max''
*[[Getnumber256]] '''''var''''' ''quotenum'' ''max''
*[[Qsprintf]] '''''destquote''''' ''srcquote'' (up to 32 arguments...)
*[[Qsprintf]] '''''destquote''''' ''srcquote'' [up to 32 arguments...]
*[[Qstrcat]] '''''destquote''''' ''srcquote''
*[[Qstrcat]] '''''destquote''''' ''srcquote''
*[[Qstrcpy]] '''''destquote''''' ''srcquote''
*[[Qstrcpy]] '''''destquote''''' ''srcquote''

Revision as of 08:34, 20 September 2009

Mapster32 Scripting M32 script commands M32 script variables


This is a categorized list of every command in Mapster32-script.

Legend:
I: acts on current sprite, S: acts on current sprite by pointer (also valid in "for i drawnsprites")
i: sets current sprite, s: only sets current sprite by pointer
D: differs from CON, X: deprecated/do not use (yet)
var/array/special: must be writable, [something]: optional command field

basic commands

control flow

struct access (redundant, except tspr)

arrays

var commands

varvar commands

math commands

special commands

  • Sort array count [comparison_state]
  • For itervar what [what2]

valid iteration types (what):

  • allsprites i, allsectors, allwalls, selsprites i, selsectors, selwalls, drawnsprites s
  • spritesofsector sector | i, loopofwall wall, wallsofsector sector, range num

var if* and while* commands

varvar if* and while* commands

other if* commands

BUILD functions

debugging commands

quote commands

findnear* (not tested)

misc. commands

current sprite commands

drawing commands

used in EVENT_DRAW2DSCREEN
used elsewhere