Jump to content

Robot Destruction Script?


AncientGamer65

Recommended Posts

Hello, all...hope I found the right area for this. :)

 

So. I'm a modder of...let's say, "medium" skill, with Scripting being my major weakness, which is why making this mod for my game has been so tough for me. Looking for some help.

 

I want to have a destruction script for all robots (Mister Handy, Mister Gutsy, Robobrains, Sentry Bots and the like) so that when I defeat them in battle, the blow up exactly like the Robo-Scorpions of Old World Blues. Being weak in the scripting area (if a script is even needed here, now that I think of it...), I don't even know where to look in the Robo-Scorpion's GECK entries for what I need to copy to the other robots, if that'e even the way to go about this. I think I need direction, more than anything...lol. :P

 

And yah, I did search the Nexus for a mod like this, but the only thing I found was a "difficulty" plug-in from a modder that made a whole suite of them for different situations...problem was, the explosions from dead robots were TOO strong...I'd like the robots to blow up just like the Robo-Scorpions. And I'd get the Monster Mod (which I assume adds this to the robots like MMM does for Fallout 3), but that mod has too many monsters for my taste.

 

I'm being picky, I know...I just want robots to blow up in the vanilla game exactly like the Robo-Scorpions do.

 

Thanks for any and all help. :)

Link to comment
Share on other sites

I'm not at my PC at the moment but here's how I'd go about it: go to the explosion tab in the GECK and filter by something like "roboscorp". If there's an explosion with that name, look at its use info (right click on it) and see when and how it's being used. Just copy that implementation for the other robots.

 

You may run into compatibility issues if it is a completely script based thing but I'm sure there'd be ways about it.

 

My guess is that the Robo-Scorpion's script has an OnDeath block which does an explosion "PlaceAtMe", or triggers a destruction stage on the Scorpion which has the explosion linked to it. Should be simple enough to copy.

Link to comment
Share on other sites

I had a quick look when I opened the GECK this morning. Seems it's simpler than I thought. This is the code responsible in the Robo-Scorpion's script:

BEGIN OnDeath

	CastImmediateOnSelf NVDLC03GiantRoboScorpionDeathSpell;

END ; OnDeath

Basically it casts an actor effect on the Scorpion that has a scripted effect which handles the explosion and dismemberment. All you need to do is use the same code above for the other robots you want to explode.

 

A more universal implementation is possible if you want all robots, even new ones from other mods, to be taken into account - but it requires some pretty advanced scripting. (You can probably ignore this because it goes above and beyond, and I know you said you're new to scripting, but I'll include it as a spoiler for completeness.)

 

 

An event handler is a script which always runs in response to an event in the game. NVSE is required to use them.

 

The handler script:

scn EvRobotOnDeath

;makes robots explode on death

ref rKilled
ref rKiller

begin Function { rKilled, rKiller }

	if (rKilled.GetIsCreatureType 6)

		rKilled.CastImmediateOnSelf NVDLC03GiantRoboScorpionDeathSpell

	endif

end

Then set the handler in a quest script:

scn RobotExplodeQuestSCRIPT

;sets the event handler so that all robots explode on death
;should be attached to a quest with "Start Game Enabled" checked

begin GameMode

	if (GetGameRestarted)
		SetEventHandler "OnDeath" EvRobotOnDeath
	endif

end

 

 

Edited by PushTheWinButton
Link to comment
Share on other sites

I had a quick look when I opened the GECK this morning. Seems it's simpler than I thought. This is the code responsible in the Robo-Scorpion's script:

BEGIN OnDeath

	CastImmediateOnSelf NVDLC03GiantRoboScorpionDeathSpell;

END ; OnDeath

Basically it casts an actor effect on the Scorpion that has a scripted effect which handles the explosion and dismemberment. All you need to do is use the same code above for the other robots you want to explode.

 

A more universal implementation is possible if you want all robots, even new ones from other mods, to be taken into account - but it requires some pretty advanced scripting. (You can probably ignore this because it goes above and beyond, and I know you said you're new to scripting, but I'll include it as a spoiler for completeness.)

 

 

An event handler is a script which always runs in response to an event in the game. NVSE is required to use them.

 

The handler script:

scn EvRobotOnDeath

;makes robots explode on death

ref rKilled
ref rKiller

begin Function { rKilled, rKiller }

	if (rKilled.GetIsCreatureType 6)

		rKilled.CastImmediateOnSelf NVDLC03GiantRoboScorpionDeathSpell

	endif

end

Then set the handler in a quest script:

scn RobotExplodeQuestSCRIPT

;sets the event handler so that all robots explode on death
;should be attached to a quest with "Start Game Enabled" checked

begin GameMode

	if (GetGameRestarted)
		SetEventHandler "OnDeath" EvRobotOnDeath
	endif

end

 

 

AAAAAA!! I looked for this script for HOURS...THANK YOU! This'll make things easy! :)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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