Jump to content

Script Brainstorm ( a.k.a. This Engine Is Killing Me).


EPDGaffney

Recommended Posts

Edit:

The dilemma outlined below is sorted out by the following function:

SetInteractionDisabled

https://geckwiki.com/index.php/SetInteractionDisabled

 

Well, detecting the exact explosion damage is still a problem, but that appears to stem from its damage being applied later than the hit; the explosions now register on the enemies and the correct HP is deducted, but this information is not readily available in a script (I am devising a work-around, but the standard methods will not work).

 

But the other nice little æsthetic things I had gained by using SetDestroyed are now present again via SetInteractionDisabled.

------------------------------------------------------------------------------------------

Original Post:

I needed to use SetDestroyed on some actors to simulate corpses because some other stuff I needed wasn't working on actual corpses. It was working really, really well. But I need these 'corpses' to be affected by explosions, and why, oh Jesus, Mary, and Joseph, why, I couldn't say, but SetDestroyed causes actors to be immune exclusively to explosions. I need this not to be the case.

 

I've tried faking it by checking is the weapon responsible an explosive weapon, using GetHitWeapon and IsWeaponSkillType but no luck for some reason. I thought it wasn't even registering the hit but it prints in the console when that block is run, so I'm guessing it's somehow not connecting the explosion to the weapon? How does the mighty and villainous Gamebryo think? Can anyone say?

Edited by EPDGaffney
Link to comment
Share on other sites

Thanks. Unfortunately, this function just doesn't work that way when used on actors. Truth is, it's meant for objects, not actors, but this is literally the only thing left for me to solve before I can move on, and SetDestroyed was working perfectly for hiding the health bars, hiding the names, hiding the compass markers, even counting headshots and letting me script things with that...it's just this thing where explosives do no damage.

Link to comment
Share on other sites

Unless the corpses need to be hit by a player weapon with all the effects that would follow from that, perhaps you could full on fake the explosion? If a hit can be detected to the corpse use a PushActorAway command using whatever variable force you want with some sort of placeat explosion maybe.

Link to comment
Share on other sites

The corpses need to be hit by the player with most of the effects of that. What I need to detect is when an explosion occurs near them, basically.

 

I've realised that OnHit is only being called when the projectile hits them, not its explosion. Which is hilarious because when they were actual corpses, the explosions were being detected perfectly but PushActorAway was not, which was the entire reason I eventually went with fake corpses.

 

I could use a GameMode block with GetDistance, but this area is getting really script-heavy, so I'd love to avoid that.

Link to comment
Share on other sites

So, removing the SetDestroyed line from the script does mostly still give me what I want. I just loved the look of the empty health bar when it occasionally did turn up (it shouldn't, ideally), and that it would just have the name of the corpse, not the action you would be attempting to initiate by activating them. Now however, it reads 'Talk' to 'Corpse'. Any other ways to hide this? Tried SetActivatorPrompt but as expected, that works only on activators.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...