Mazze Posted November 11, 2017 (edited) Been playing a bit of RoTT and gained the inspiration to make Doom maps with similar traps. Most specifically I want to be able to implement turrets or 'walls' that fire projectiles at a constant rate, and can be activated/deactivated by the player. All I've found are zDoom artillery strikes which is not what I want. Any ideas? Edited November 18, 2017 by Mazze 0 Share this post Link to post
scifista42 Posted November 11, 2017 In DECORATE, create a thing that can be (de)activated and that, while active, repeatedly calls A_CustomMissile with CMF_AIMDIRECTION flag to fire projectiles straight forward. In the map, control the thing by calling Thing_Activate and Thing_Deactivate from ACS or line/sector/thing actions. 1 Share this post Link to post
Mazze Posted December 5, 2017 On 11/11/2017 at 7:49 PM, scifista42 said: In DECORATE, create a thing that can be (de)activated and that, while active, repeatedly calls A_CustomMissile with CMF_AIMDIRECTION flag to fire projectiles straight forward. In the map, control the thing by calling Thing_Activate and Thing_Deactivate from ACS or line/sector/thing actions. Thank you for your reply! I'm quite a noob, and have never created a thing before. What I have so far is this... ACTOR Turret 3203 { Radius 20 Height 56 Activation THINGSPEC_Activate +SOLID +USESPECIAL -PUSHABLE Obituary "%o was splattered by the turret's rocket." MONSTER States { Spawn: MPOS A 5 A_Look Loop Active: Missile: MPOS F 5 MPOS G 13 A_CustomMissile("TurretShot",32,0,0,0,CMF_AIMDIRECTION) Loop } } At the moment my 'monster' just stands there and never carries out A_CustomMissile. The 'TurretShot' is just a copy and paste from a working monster in case you're wondering. Would love to know how to make the 'Active' code run. 0 Share this post Link to post
Empyre Posted December 5, 2017 (edited) You need a See: state. A_Look sends the monster to the See: state when it sees a target. A_Chase sends the monster into its Melee: state or Missile: state (depending on the distance) to do the actual attack. Speed 0 should keep your turret from moving around. It should look something like this: ACTOR Turret 3203 { Radius 20 Height 56 Speed 0 Activation THINGSPEC_Activate +SOLID +USESPECIAL -PUSHABLE Obituary "%o was splattered by the turret's rocket." MONSTER States { Spawn: MPOS A 5 A_Look Loop See: MPOS A 5 A_Chase Loop Melee: Missile: MPOS F 5 A_FaceTarget MPOS G 13 A_CustomMissile("TurretShot",32,0,0,0,CMF_AIMDIRECTION) Goto See } } EDIT: I just saw that you want the player to be able to activate or deactivate the turret. The code I posted will not do that. Activating things is outside my experience. Edited December 5, 2017 by Empyre 1 Share this post Link to post
scifista42 Posted December 5, 2017 (edited) 3 hours ago, Mazze said: Would love to know how to make the 'Active' code run. In a map editor, give a tag to the thing, and call Thing_Activate with this tag from an ACS script or from line action or from wherever action specials can be called from. If you want to be able to deactivate it, define an "Inactive:" state on the thing, and call Thing_Deactivate like you called Thing_Activate. Your thing doesn't need "Activation THINGSPEC_Activate" and "+USESPECIAL", unless you want the player to activate it by pressing use onto the thing itself rather than remotely. Don't call "A_Look" in its Spawn state, that's only useful for monsters who look for players. The "MONSTER" combo is probably not appropriate to use either. The "Missile:" label and "-PUSHABLE" are redundant, and "+SOLID" is only useful if you want the thing to be blocking. See DECORATE format specifications, Actor flags, Actor properties and Actor states for what you can use in actor definitions to create whatever behavior you want. Edited December 5, 2017 by scifista42 1 Share this post Link to post
Mazze Posted December 5, 2017 2 hours ago, scifista42 said: In a map editor, give a tag to the thing, and call Thing_Activate with this tag from an ACS script or from line action or from wherever action specials can be called from. If you want to be able to deactivate it, define an "Inactive:" state on the thing, and call Thing_Deactivate like you called Thing_Activate. I noticed in the documentation it mentions 'Active:' and 'Inactive:' apply to Hexen, does this mean my map has to be in 'Hexen ACS' format and not 'ZDoom ACS' format? I have a linedef which shares the same tag as my thing (using 'Activate Thing' in the linedef options), but the switch doesn't appear to change the behaviour. By the way, apologies because I know this must be pretty tiresome when I can't figure out basic stuff. 0 Share this post Link to post
scifista42 Posted December 5, 2017 4 minutes ago, Mazze said: I noticed in the documentation it mentions 'Active:' and 'Inactive:' apply to Hexen, does this mean my map has to be in 'Hexen ACS' format and not 'ZDoom ACS' format? It doesn't mean that, at all. 4 minutes ago, Mazze said: I have a linedef which shares the same tag as my thing (using 'Activate Thing' in the linedef options), but the switch doesn't appear to change the behaviour. I just noticed your thing doesn't inherit from SwitchableDecoration, which is essential to make it work, as implied (admittedly not entirely clearly) at the beginning of this page. Write "ACTOR Turret : SwitchableDecoration 3203" in place of "ACTOR Turret 3203". 0 Share this post Link to post
Arctangent Posted December 5, 2017 No, it's just that out of all the base games ZDoom supports, only Hexen uses the feature. However, just about every feature is freely usable in every game that ZDoom supports, and if it isn't it's probably a Strife feature. 0 Share this post Link to post