Weapon loss prevent - scripting help

Post » Sat May 28, 2011 1:49 pm

Hello,
I'm creating custom companion (creature) that uses super mutant skeleton.
I have noticed that he's losing his weapon very often (enemy shoots his weapon) how to prevent that ?
User avatar
NEGRO
 
Posts: 3398
Joined: Sat Sep 01, 2007 12:14 am

Post » Sat May 28, 2011 5:55 am

Hello,
I'm creating custom companion (creature) that uses super mutant skeleton.
I have noticed that he's losing his weapon very often (enemy shoots his weapon) how to prevent that ?


Give his weapon more health, I would think.
User avatar
Danny Warner
 
Posts: 3400
Joined: Fri Jun 01, 2007 3:26 am

Post » Sat May 28, 2011 2:05 pm

Emm nope, I want him to use diffrent weapons, I cant just simply increase health of every weapon in game.
User avatar
james tait
 
Posts: 3385
Joined: Fri Jun 22, 2007 6:26 pm

Post » Sat May 28, 2011 12:00 pm

Then you could run a check in GameMode to see if he lost his weapon (GetItemCount) and replace his weapon with a new one.

scn FearilScript

Ref Weapon

Begin Gamemode

set Weapon to GetEquippedObject 5

If GetITemCount Weapon == 0

AddItem Weapon

EndIf

End

Something like that atleast.
User avatar
Karen anwyn Green
 
Posts: 3448
Joined: Thu Jun 15, 2006 4:26 pm

Post » Sat May 28, 2011 6:26 pm

What about script that sets equipped weapon unplayable or adds 'can't drop' flag to it
User avatar
D LOpez
 
Posts: 3434
Joined: Sat Aug 25, 2007 12:30 pm

Post » Sat May 28, 2011 5:20 pm

What about script that sets equipped weapon unplayable or adds 'can't drop' flag to it


Ya know, that might indeed be a lot easier. But FOSE doesn't have those functions yet. You van request them at the official thread.
User avatar
DAVId Bryant
 
Posts: 3366
Joined: Wed Nov 14, 2007 11:41 pm

Post » Sat May 28, 2011 10:49 am

That wouldn't be a great idea as the functions apply to all weapons of the same type, so if you gave him a minigun you couldn't disarm super mutants with miniguns.
User avatar
Charles Mckinna
 
Posts: 3511
Joined: Mon Nov 12, 2007 6:51 am

Post » Sat May 28, 2011 11:17 am

So ? Any other ideas ?
Maybe weapon health freezing script ?
User avatar
Gemma Woods Illustration
 
Posts: 3356
Joined: Sun Jun 18, 2006 8:48 pm

Post » Sat May 28, 2011 3:46 am

So ? Any other ideas ?
Maybe weapon health freezing script ?


I think you'll have to take Harmy52's script suggestion as a start. I would put it in a quest script with about .5 second delay. It will get complicated by the fact that the SM will use different weapons. You will have to keep track of when weapons switch so you can keep the weapon REF up to date, apply health to it, scan the SM's container to check if it even has a weapon, then if not - re-add it usining the previous weapon REF, ammo, etc.

You might also add to the SM's object script a check for arm-limb health, and make sure it doesn't go too low - I think if the arms get crippled they will be more likely to drop weapons too. I think Phalanx doesn't let the limbs drop below 60
User avatar
Emily Jones
 
Posts: 3425
Joined: Mon Jul 17, 2006 3:33 pm

Post » Sat May 28, 2011 6:10 pm

Hello,
I'm creating custom companion (creature) that uses super mutant skeleton.
I have noticed that he's losing his weapon very often (enemy shoots his weapon) how to prevent that ?


The way you do this is create a custom weapon just for him (copy an existing one if you like), in the weapon's flags you click off like "can not drop" (I think that's it) and "playable" is not selected,, then you edit the creature's inventory and put the weapon in there.

Emulate the setup of, for example, Charon and his shotgun, to get that working. Charon's shotgun is set up to never run out of ammo, I'm not sure quite what you wanted to do with that.

It does not apply to weapons the player gives him, just that one he spawns with. You sorta cannot make NPCs never drop any weapon the player passes them, the flags that provide this are special and live on custom weapons only.
User avatar
Karine laverre
 
Posts: 3439
Joined: Tue Mar 20, 2007 7:50 am


Return to Fallout 3