Jump to content

Scripting Assistance


McclaudEagle

Recommended Posts

Hi there.

 

I have two things I need help scripting. The first is to make vertibirds immune to small arms fire (pistols, shotguns, assault rifles), but not immune to certain heavy weapons (minigun, missile launcher, gatling laser). I was told I'd need to create a Form List of the weapons, and a script using the OnHitWith string, but I am only a novice when it comes to scripts and wouldn't know how to finish this.

 

The second is to add a bleed-out script for each limb. Each limb needs to have a random chance to bleed-out, with a severity dependant on the limb itself (torso bleed-out faster than legs). The bleed-out also needs to be able to be stopped by using a certain item.

 

If anyone can help me, I'd appreciate it.

Link to comment
Share on other sites

I think this might help you: My linkhttp://cs.elderscrolls.com/index.php/OnHitWith

I'm new to scripting myself, so this might not be 100% correct, but this is what I would do:

 

Create an object script and associate it with the vehicle. Get the objectIDs of the weapons you want nullify. Here's a link to the hexcode object IDs for the fallout 3 game http://www.gamewinners.com/Cheats/index.php/More:Fallout_3_%28PC%29:_Item_Codes#Weapons

 

Then I think all you would have to do is the following script:

BEGIN OnHitWith ObjectID
 ObjectID.setAttackDamage  0
END

 

 

To get multiple weapons nullified, I think you could either duplicate this script with the corresponding objectIDs or use a FormList and iterate through the list via a loop. This is possible because the OnHitWith function will accept a FormList as an argument http://geck.bethsoft.com/index.php/OnHitWith. Here's how to create a FormList within the GECK http://geck.bethsoft.com/index.php/Scripting_Tutorial:_Working_with_FormLists. You can also modify FormList objects in-game with scripts, so that, for example, you could nullify the damage from a missile launcher, but when some condition is meet by the player (like you flip a switch to turn off a vehicle's "shields") then the damage is no longer nullified.

 

Then with your FormList and whatever ID you give it (MYFormListID for this lil tutorial here) I think it would just be:

ref MyWeapon
int length                 ## The number of weapons stored MyFormListID is the number of indices of MyFormListID
int count                  ## The index of MyFormListID where each weapon is stored in a single index
set count to 1          ## Either 1 or 0, I'm not sure from what number indexing begins in MyFormList objects
BEGIN OnHitWith MYFormListID
 length ListGetCount MyFormListID                
 Label 1                                                                    ## Labeling a block so we can repeat it as many times as we need (in this case only 'length' times)
 If count < length                                   ## Will be true the first time and this is where 'Goto 1' will return to
   MyWeapon ListGetNthForm MyFormListID count                     ## Retrieve the weapon stored at index count and store it in reference MyWeapon
   MyWeapon.setAttackDamage 0
   set count to count + 1                        ## Set the index to the next list item
   If  count <= length                     ## If count > length, we are done and need to exit this loop, otherwise we need to go back and repeat previous lines
      Goto 1                                                                ## Repeat all instructions following the line Label 1, but with count incremented by 1
   endif                                                  
 endif                ## If we make it here, we have processed each individual item in MyFormListID        
END

 

 

Don't forget to name these scripts though! And I'm not sure if the script compiler ignores whitespace, so you may or may not have to properly indent and space everything. I think the duplicating the first script would be faster, I'm not sure. I haven't tested these scripts. But I hope this much helps. You can pm me if you can't get it to work. cya

 

EDIT: Here's a link on how to do looping with FOSE http://www.cipscis.com/fallout/tutorials/loops.aspx (as the default vanilla scripting langauge for Fallout 3 does not support looping constructs)

Edited by brainfungus
Link to comment
Share on other sites

  • Recently Browsing   0 members

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