Jump to content

40mm Impact Script


Billtcm

Recommended Posts

Hey everyone. I'm working on a quest where you're given a weapon that shoots 40mm projectiles and when it hits ONLY robots they are sent back to the quest bearers residence. I was going to have the projectile hit the actor, check if it was a robot (through an ifcontainer == 'said npc') then delete the original npc and spawn a new 'custom brainwashed' robot that would have an 'aipackage' to return to the home and fulfill the quest.

 

Only thing is I'm having trouble with the projectile detecting anything at all. At the moment I have the code below that doesn't seem to be doing much, I get no message or indication. Do I need something after 'onhit'? This is located in the 'impact script' under my new projectile I've created.

 

scn grenadeexplode

Begin Onhit
ShowWarning "Your Script Works!"
End

 

If anyone could help me I'd appreciate it, thanks!

Link to comment
Share on other sites

Okay I figured out the last part, sorry if this gets bumped up. I didn't think I would be making any progress to be honest.

 

ScriptName grenadeexplode

BEGIN ScriptEffectStart

IF getInFaction RobotFaction == 1			
	Disable
	PlaceAtMe 000MyRobot
ENDIF

END

 

Now I just need to find out how to distinguish what type of robot what hit and then to take that variable and set it to the 'placeatme' variable.

Edited by Billtcm
Link to comment
Share on other sites

Can't you just add a script package to them with the destination of your home? If you use a wander package and set it to must reach location and must complete they should go there and stay until you add another package or remove the one you added.
Link to comment
Share on other sites

Yeah I have that included at the moment once the new robot spawns. What I'm having trouble with now is having the script figure out 'what type' of robot is hit. For instance if I shoot both a protectron and Mr. Gutsey at the moment they both spawn a protectron and then go home. I need a way to have the script distinguish between what type of bot it has hit and then spawn the appropriate one.

 

I tried the following but it wouldn't spawn anything with it.

 

ScriptName grenadeexplode

BEGIN ScriptEffectStart

       IF CrProtectrion == 1                       
               Disable
               PlaceAtMe 000MyProtectron
; (After this I would do an 'elseif' command and then list other types of bots, yet for some reason the game doesn't recognize CrProtectron in game, it just kills the bot now)
       ENDIF

END

Link to comment
Share on other sites

probably need getisid CrProtectrion

 

What I'm saying is just add the scriptpackage to the robot hit by the projectile, then there is no need to change him with the correct type. Is there something special about the one you are replacing them with that requires them to be replaced, or you just need the same looking robot to go home?

Link to comment
Share on other sites

ScriptName grenadeexplode

BEGIN ScriptEffectStart

addscriptpackage MyPackage

END

 

Where MyPackage is a wander package you create with your home as the target. Make sure must reach location, and must complete is checked to ensure the package is not removed by the actor evaluating their packages.

 

edit: just be sure the weapon and effect do no damage and are non hostile to ensure the actor doesn't want to kill you.

Edited by b3w4r3
Link to comment
Share on other sites

  • Recently Browsing   0 members

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