header general

Item activation question

  • doomedarchviledemon
  • doomedarchviledemon's Avatar Topic Author
  • Pain Elemental
  • Pain Elemental
More
8 years 2 months ago - 8 years 2 months ago #1 by doomedarchviledemon
Item activation question was created by doomedarchviledemon
I am trying to get a usable item to 'activate' when an enemy walks over it but cannot figure out how to make something 'activate' when an enemy makes contact. I have been looking at the Land Mine Layer weapon as an example but don't understand what I am doing differently to make my Bear Trap item not work. Any help would be appreciated.

Bear Trap
Last edit: 8 years 2 months ago by doomedarchviledemon.

Please Log in or Create an account to join the conversation.

  • MagicWazard
  • MagicWazard's Avatar
  • Moderator
  • Moderator
More
8 years 2 months ago #2 by MagicWazard
Replied by MagicWazard on topic Item activation question
Well, for starters, the BearTrapSet actor doesn't have any properties that give it collision, such as either +SOLID or PROJECTILE. The Mine Layer mine is treated as a projectile; so, I added the following flags to give BearTrapSet projectile-style properties:
+MISSILE (gives it collision)
-NOGRAVITY (so it doesn't "fly")
+NOEXPLODEFLOOR (so it doesn't "die" when it hits the floor)

However, even then, the BearTrapSet actor wouldn't "die" if a monster contacted it. The workaround I found was to set the damage from 0 to 1. For some reason, I guess, if the "projectile" doesn't cause any damage, it doesn't "die" when a monster walks into it.

I'll be honest--I don't know the absolute best way to rig something like this up. But hopefully this at least is a start.

Please Log in or Create an account to join the conversation.

  • ozymandias81
  • ozymandias81's Avatar
  • Pain Elemental
  • Pain Elemental
More
8 years 2 months ago #3 by ozymandias81
Replied by ozymandias81 on topic Item activation question
Before my pc nearly death, I was in the way to test something with switchabledecorations through Thing_Spec MonsterTrigger activation and BUMPSPECIAL flags + this actor from Blade of Agony. Dunno if it will be of some help for the purpose but I thought it was good to left my thinkings here. Sorry for the shitty way to post this, my phone don't know good manners.

https://github.com/Realm667/WolfenDoom/blob/master/actors/hazards/mine.txt

Please Log in or Create an account to join the conversation.

  • doomedarchviledemon
  • doomedarchviledemon's Avatar Topic Author
  • Pain Elemental
  • Pain Elemental
More
8 years 2 months ago #4 by doomedarchviledemon
Replied by doomedarchviledemon on topic Item activation question
Thank you both for the help. I now have the Bear Trap working as intended. There's only one more thing I'd like to make happen, if it's possible, before putting this up for submission. That is making the Active Trap stick to the enemy when triggered. As it is now it is possible for the player to shoot the enemy away from the trap when they should be completely immobilized until the trap breaks. Is there a way to make an inventory drop item stick to an enemy?

An updated version of the bear trap can be downloaded on the first post.

Please Log in or Create an account to join the conversation.

  • MagicWazard
  • MagicWazard's Avatar
  • Moderator
  • Moderator
More
8 years 2 months ago - 8 years 2 months ago #5 by MagicWazard
Replied by MagicWazard on topic Item activation question
So, do you want the trap to just stick to the monster, or for the monster to stick to the trap? It kind of sounds like the latter. If you just want the former, the Bio Pipebomb Launcher is able to have its projectiles stick to a monster, though I'm not sure if it's the most elegant example. It looks like it relies mostly upon A_Fire to "stick" the projectile to the monster. As for the latter option, immobilizing the monster? Probably what you'll want to do is make the activated trap "solid" and "blocking" using A_ChangeFlag during the lifespan of the bear trap, and hope that this "traps" the monster while it's active. You could probably also do some more convoluted stuff using an ACS script (or maybe the new A_SetSpeed ) to change the Speed value of the monster to 0, but that would probably be more work than just making the trap solid so the monster is stuck in it.
Last edit: 8 years 2 months ago by MagicWazard.

Please Log in or Create an account to join the conversation.

  • ozymandias81
  • ozymandias81's Avatar
  • Pain Elemental
  • Pain Elemental
More
8 years 2 months ago #6 by ozymandias81
Replied by ozymandias81 on topic Item activation question
I bet that doomedarchviledemon will need to check A_Warp tricks.

Please Log in or Create an account to join the conversation.