header general

Possession Sphere ZScriptification help

  • Salahmander
  • Salahmander's Avatar Topic Author
  • BFG Commando
  • BFG Commando
More
1 week 4 days ago #1 by Salahmander
Possession Sphere ZScriptification help was created by Salahmander
So am looking to convert the Possession Sphere effects without ACS and if possible, without making any new actors, and if it is possible without any new actors, is there a way to implement enemies having a resistance to it, is there anyone that can help?

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

  • DeVloek
  • DeVloek's Avatar
  • Arachnotron
  • Arachnotron
More
1 week 4 days ago #2 by DeVloek
Replied by DeVloek on topic Possession Sphere ZScriptification help
It's certainly possible to replicate the item's behavior without making new actors, not sure about resistances though. What kind of resistance are you thinking about? Like a complete immunity for certain monsters? You could tie it to the BOSS flag, or maybe something more dynamic would be cool, eg. smaller monsters like zombiemen stay possessed for a full minute while bigger monsters like cyberdemons only for a few seconds.
If you still need help with this let me know, I might be able to cook something up later tonight or tomorrow.

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

  • Salahmander
  • Salahmander's Avatar Topic Author
  • BFG Commando
  • BFG Commando
More
1 week 4 days ago #3 by Salahmander
Replied by Salahmander on topic Possession Sphere ZScriptification help
By resistances, I mean the probability of an enemy getting possessed. But of course, full immunity could be something to implement. I'm still happy to have help with it man. :)

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

  • DeVloek
  • DeVloek's Avatar
  • Arachnotron
  • Arachnotron
More
1 week 2 days ago #4 by DeVloek
Replied by DeVloek on topic Possession Sphere ZScriptification help
While playing around with the original item I noticed that the ghost projectile that turns a monster friendly is destroyed once it hits a wall, and it also targets barrels which ofc doesn't work. I don't think that's intended, and it often results in wasting the artifact. The seekermissile behavior doesn't really help, often the ghost doesn't go for the monster you're aiming at but seeks out another one that may be behind an obstable. I managed to fix these issues, but I still have to fix some others that came up during the zscript conversion. For now, here's the current changelog:
  • The ghost no longer targets barrels and now passes through them
  • The ghost is no longer destroyed when hitting level geometry, bounces off instead
  • Improved seeker code, now the ghost seeks new targets when the current target is already possessed or otherwise can't be affected
  • Added a "maxcharges" property to the ghost. Now it can continue seeking out monsters to turn friendly until all charges are used
  • Added an "allowbosses" property to the ghost, this determines if monsters with the BOSS flag should be affected or not
  • Added dynamic possession duration based on monster health. High hp monsters stay possessed much shorter than low hp monsters. For example a Cyberdemon is possessed for only a couple seconds while a Shotgunguy is possessed for a few minutes. This can be toggled off so the original 45 seconds duration is used for all monsters.
  • Adjusted ghost sprite offsets to make it look less jittery
  • The possession indicators are now particles instead of actors
Let me know if it's a bit too much, most of these changes can be easily reverted back to the old behavior but imo they make the item much more useful.

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

  • DeVloek
  • DeVloek's Avatar
  • Arachnotron
  • Arachnotron
More
1 week 2 days ago #5 by DeVloek
Replied by DeVloek on topic Possession Sphere ZScriptification help

By resistances, I mean the probability of an enemy getting possessed. But of course, full immunity could be something to implement. I'm still happy to have help with it man. :)
I don't know if probability is a good idea tbh. This might become really frustrating when you waste all your PossessionSpheres on one monster that has a 50% chance to be possessed but RNG just won't do you the favor. It should be all or nothing imo. That's why I like the idea of a dynamic duration so much, it kinda acts like a resistance as bigger monsters are possessed for a shorter time. But I left the original behavior in there as a toggle so people who prefer that can still use it. If you have any other idea how to solve this let me know.

I will upload a working version for you to try out once I fixed an annoying bug that is still in my code.

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

  • Salahmander
  • Salahmander's Avatar Topic Author
  • BFG Commando
  • BFG Commando
More
1 week 2 days ago #6 by Salahmander
Replied by Salahmander on topic Possession Sphere ZScriptification help
I'm happier with your route, it works really well. :D

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

  • DeVloek
  • DeVloek's Avatar
  • Arachnotron
  • Arachnotron
More
1 week 2 days ago #7 by DeVloek
Replied by DeVloek on topic Possession Sphere ZScriptification help
Alrighty, this is what I got so far.

https://drive.google.com/file/d/1KJQAg9EPOl0XHzabxorS0Fg65UQV7oST/view?usp=sharing

This includes a few more fixes. The one annoying bug I mentioned was actually caused by UZDoom itself, it resulted in a fatal crash upon exiting the game while a monster is possessed. Hopefully this will be fixed at some point but for now I found a simple workaround (moved the code from EndEffect to the last tick of DoEffect) so the artifact is working as intended.

Changelog addendum:
  • Added isFrozen check so frozen monsters cannot be possessed
  • Killing possessed monsters now counts towards total kills
  • Increased ghost projectile's homing range and turn angle
  • Some minor visual/audio fixes
Todo:
  • Add dynamic light to possessed monsters

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

  • DeVloek
  • DeVloek's Avatar
  • Arachnotron
  • Arachnotron
More
1 week 2 days ago #8 by DeVloek
Replied by DeVloek on topic Possession Sphere ZScriptification help
Updated the pk3 on my google drive, see the full changelog in UPDATES.txt. I also included Blue Shadow's old code in a seperate folder.

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