Activatebysector: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Plugwash (talk | contribs)
No edit summary
 
Gave this command proper documentation.
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
''activatebysector'' calls the activatebysector function in sector.c it takes two parameters both gamevars. but it is uncommented and i can't figure out what it is actually supposed to do.
<span {{code}}>'''activatebysector''' <sectNum> <spriteNum> </span>


<sect> presumablly a sector.
This command either triggers all ACTIVATOR sprites (tile 2) contained in the sector with the specified index, or if none are found, activates the effect defined by the [[Sector_Tag_Reference_Guide|tag]] of that sector.
<j> possiblly an activator number or a player number or something.
 
Note that unlike [[operateactivators]] it does not trigger ACTIVATORLOCKED sprites (tile 4).
 
====Arguments====
 
* <span {{code}}><sectNum></span>: Either a [[gamevar]] or constant. Refers to the sector index whose effects (ACTIVATOR sprites contained within, or tag if none found) are to be activated.
* <span {{code}}><spriteNum></span>: Either a [[gamevar]] or constant. Only used if no ACTIVATOR sprites are found. In this case, the purpose of this value is defined by the sector tag:
:* For sector tags <code>{9,16,17,18,19,20,21,22,26,27,28,29,30,31}</code> it refers to the sprite id that serves as the origin for the sound played by the sector when its effect is activated.
::This requires a MUSICANDSFX sprite to be present in the same sector. If set to -1, the origin will default to the MUSICANDSFX sprite.
:* For sector tag 15 (ST_15_WARP_ELEVATOR), it refers to the player sprite that is to be transported. If the sprite does not refer to a player (i.e. picnum is not 1405), the effect will not occur.
 
[[Category:EDuke32 specific commands]]
[[Category:Sector manipulation]]

Latest revision as of 05:50, 9 January 2021

activatebysector <sectNum> <spriteNum>

This command either triggers all ACTIVATOR sprites (tile 2) contained in the sector with the specified index, or if none are found, activates the effect defined by the tag of that sector.

Note that unlike operateactivators it does not trigger ACTIVATORLOCKED sprites (tile 4).

Arguments

  • <sectNum>: Either a gamevar or constant. Refers to the sector index whose effects (ACTIVATOR sprites contained within, or tag if none found) are to be activated.
  • <spriteNum>: Either a gamevar or constant. Only used if no ACTIVATOR sprites are found. In this case, the purpose of this value is defined by the sector tag:
  • For sector tags {9,16,17,18,19,20,21,22,26,27,28,29,30,31} it refers to the sprite id that serves as the origin for the sound played by the sector when its effect is activated.
This requires a MUSICANDSFX sprite to be present in the same sector. If set to -1, the origin will default to the MUSICANDSFX sprite.
  • For sector tag 15 (ST_15_WARP_ELEVATOR), it refers to the player sprite that is to be transported. If the sprite does not refer to a player (i.e. picnum is not 1405), the effect will not occur.