danshive Posted June 20, 2011 Share Posted June 20, 2011 I'm new to the GECK and am looking for ways to determine which actor I've just targeted with my scripts, such as from a weapon. I have a few reasons I'd like to be able to do this. For example, I did what any seasonable person would do and made a gun that turns people into rad roaches. Okay, from a code perspective, it shrinks, kills, and spawns a rad roach where a target was while some flashy particle effects flash, but whatever. Point is, I'd like to be able to alter the behavior of the script depending on who gets roach-i-fied, possibly making it possible to reverse the effects by resurrecting the PC, turning them into something else, whatever. I personally think it would be funny if the Roach King became a deathclaw belonging to the radroach faction and the antagonizer into an ant queen, but my point is merely that there are applications for knowing who you're shooting. Any advice is greatly appreciated. I haven't checked out the possibilities with FOSE yet, but at this rate I'm already pushing the limits of the GECK from the standpoint of stupid crazy weapons. And so long as I'm asking for advice, the roach morph code. As I said, I'm new to GECK, plus the special effects are snagged from another script, so there's a good chance this could be improved. Certain conditions that are currently being used in the object effect should probably be hard-coded into it, such as not being able to target children and characters who won't die (it effectively just turns them invisible). I also have an addition script on the object effect that removes all items from the actor before the change, as this method of "kill" leaves no corpse to loot. scn TFRoachSpell short RoachMade ; 0 = no roach, 1 = a roach float timer ; For timing the roach appearance with actor disappearance short init ; Make sure timer is set once float shrinkVar ; For keeping track fo the shrinking. Begin scripteffectstart SetCriticalStage DisintegrateStart ; The visual effects are pretty much taken directly from the alien disintegration spell. I honestly don't know how necessary this is. set RoachMade to 0 set shrinkVar to 1 setscale shrinkVar PMS AlienCritGlowFXShader ; Fancyspecialeffects PMS effectAlienDisintegration End Begin scripteffectupdate if init == 0 set timer to 1.8 set init to 1 else if timer > 0 if shrinkVar > 0.25 set shrinkVar to shrinkVar - 0.01 setscale shrinkVar endif if shrinkVar < 0.25 setscale 0.25 endif else if RoachMade == 0 if getinfaction RadRoachFaction == 0 ; If it's already a rad roach, we don't need another one, do we? PlaceAtMe TFRadRoach 1 ; This is a custom rad roach set to not respawn. endif set RoachMade to 1 DamageActorValue Health 3000 ;Killactor has resulted in glitches, has did a single 10,000 damage command. 12,000 over four quarters seems to work juuuuust fine DamageActorValue Health 3000 DamageActorValue Health 3000 DamageActorValue Health 3000 SetCriticalStage DisintegrateEnd SMS AlienCritGlowFXShader SMS effectAlienDisintegration endif endif endif set timer to (timer - getSecondsPassed) End Link to comment Share on other sites More sharing options...
Recommended Posts