Jump to content

Recommended Posts

Posted

Ok, I've been working on a few miscellaneous mods to do some minor tweaks to gameplay.

 

One is that I want to eliminate the ability of the player to repair weapons and armor with other weapons and armor and totally depend on either repair stations or repair kits. Kits are already in the game and repair stations are easy enough to create, but how do I prevent the player from using either the R key or Y button on the controller? I see the Lutana NVSE functions could be used for something like this, but am a bit at a loss to force the engine to do nothing when these keys/buttons are pressed.

 

 

The other issue is a bit more complex... I want to stop the Powder Gangers around the wasteland from respawning once Eddie is dead. I see that the respawn flag can be accessed using a Bitmask, but I'm at a loss on how to properly manipulate bitmasks in Geckscript.

Posted

I think I made the second bit more complicated than it actually is...

 

How's this sample...

 

scn aaPowderGangerRespawnFix
Begin GameMode
if (NCRCFEddieRef.GetDead == 1) ;Is Eddie a deadie?
SetActorBaseFlagsLow 8, PowderGangerMeleeAAMTEMPLATE ;Set fourth bit which represents the respawn flag
endif
End
Does that have a chance at working? I'm not sure if the SetActorBaseFlagsLow function always sets to "true" or will actually set it to the opposite of what it currently is.
Posted (edited)

Two ideas immediately come to mind for the repair question. For the first you could detect when the player is in the inventory menu, then disable the R and Y key and button. You'd need to detect when the player has left the inventory screen (either to game-mode or another menu) and then re-enable the controls so this method would require MenuMode and GameMode blocks with a relatively quick delay. Therefore you need to make sure you doing stuff efficiently or there might be performance concerns.

 

 

  Reveal hidden contents



The second idea would be to detect when the player is viewing the inventory screen, then use SetUIFloat to set the <visible> trait of the repair button to 0. This'll be preferable to the other method as it removes the button and so the player won't find it strange that the option is there, but they can't use it. Whatever method you choose, I'd also recommend changing the tutorial and help messages to reflect your changes - those kind of inconsistencies drive me up the wall!

 

 

  Reveal hidden contents



Bitmasks can be a bit tricky to get your head around: they're a single integer which is the sum of the binary flags (bits). So if the 1st flag (decimal = 1), 3rd flag (dec = 4), and 4th flag (dec = :cool: are set then the total would be 13. Only one combination could ever add up to this values so that's how it works.

Anyway, first you need to retrieve the bitmask using the "Get" function for the flags you're editing, then use SetBit on the retrieved bitmask to set the appropriate flag (bit) to what you want, THEN use the "Set" function for the flags to set them to your edited bitmask them. A word of warning, though - I once tried setting the respawn flag on an actor but I couldn't get it to take effect. The flag was definitely set but I don't know if maybe I was testing it wrong, or the cell wasn't set to reset or something.

 

 

  Reveal hidden contents

 

Edited by PushTheWinButton
Posted

I hadn't looked too closely into it, but I didn't really know much about the Fallout menus. I didn't know that editing the menu actually disables the input from a device whether it be a keyboard or a controller. So, I simply edited the XML document and killed the Repair button that way. Lo and behold, it worked.

 

It still needs further editing to move around the other menu elements so the command looks like it was never there and I am going to create an esp with repair stations... but what a great feature to add to my game. It drove me crazy that you could get fully repaired high value weapons from killing a few hit squads, or that you could clear a dungeon (Shadow Company from NVB2 is a good example) and walk out with 2-3 fully repaired sets of combat armor.

 

 

I'm going to play around with the bitmask thing too... I've used a similar system in other languages where you used an integer to point to a particular bit in a 16 bit word, but the way Geckscript handles them seems a little clunky to me. I'll get it working eventually.

 

In your experiments, were you trying to force a non-respawning NPC/Creature to become respawning? If so, you may be correct and something else was coming into play.

Posted

If you plan on releasing your mod then you might need to find a way around editing the .xml file, because many people use UI mods which have different files.

 

Yep, I was trying to make the Goodsprings Settlers respawn if killed and it wasn't working. It's one of those things that's really hard to test and I ended up drifting into other things so I never worked it out. I'm not sure if the flags are a persistent change or not either. Most NVSE changes are only in the memory so don't save with the game. Very few are permanent - setting a weapon reference's active mods is the only one that comes to mind right now. It may also be the case that setting flags on a base form isn't permanent whereas settings flags on a reference is. Probably needs testing.

 

A sure-fire and pretty unclean method of getting rid of them would be to just Disable the actors instead of editing the respawn flag. Obviously, this would definitely be permanent but it'd be difficult to reverse if you want your mod to be remove-able. Depends what you're going for.

Posted

I hear you man, I don't like New Vegas's repair system too and it's one of the only changes they made from Fallout 3 that I honestly hate.

 

Good luck with your mod.

Posted (edited)

I just had a cool idea to fix the easy repairing you mentioned. I know it's not what you wanted but I thought it would be good to mention it.

You could remove all items from weapons' repair lists and replace then with Weapon Repair Kits or something. That would mean you couldn't repair a weapon with another weapon - instead you'd need to use the repair interface to fix it with a repair kit or whatever other misc item you wanted the player to use. Fairly quick and easy to do with Lutana NVSE and it utilises the existing game systems so you won't have issues working around it.

  Reveal hidden contents

 

Edited by PushTheWinButton
Posted
  On 8/26/2016 at 7:27 AM, PushTheWinButton said:

I just had a cool idea to fix the easy repairing you mentioned. I know it's not what you wanted but I thought it would be good to mention it.

 

You could remove all items from weapons' repair lists and replace then with Weapon Repair Kits or something. That would mean you couldn't repair a weapon with another weapon - instead you'd need to use the repair interface to fix it with a repair kit or whatever other misc item you wanted the player to use. Fairly quick and easy to do with Lutana NVSE and it utilises the existing game systems so you won't have issues working around it.

 

 

  Reveal hidden contents

 

 

This is a thing of beauty. I originally just wanted to do this very thing... get rid of the repair lists altogether and make weapons repairable with repair kits, armors with some sort of armor repair kit and so forth. For the life of me I couldn't get rid of the ability to repair a weapon/armor with a duplicate of the item.

 

I will be testing this out as soon as I get a chance.

 

Some questions on the script... I couldn't find GLTA in the Geck documentation. I know it must have something to do with the repair lists, but I'm a guy that likes to know exactly what the code is that I am using.

 

 

For the "jury rigging" perk... my original thought was to open up recipes that enabled the player to craft a repair kit with a weapon rather than finding all the necessary components, with bigger, heavier weapons yielding more kits, but that's just a brainstorm, not something I had settled on.

Posted (edited)
  On 8/29/2016 at 4:50 AM, RoyBatterian said:

I think you can always repair a weapon or armor with another that's the same type.

 

Yeah, seems you can. Dang, I thought that would be a great idea. Makes you wonder why they bothered making repair lists for every weapon and armour if they were only going to populate them the same item in 99% of cases. Oh well.

 

  On 8/29/2016 at 2:16 AM, smit8420 said:

 

Some questions on the script... I couldn't find GLTA in the Geck documentation. I know it must have something to do with the repair lists, but I'm a guy that likes to know exactly what the code is that I am using.

 

 

Sorry, the GLTA function is a shortened alias for "GetLoadedTypeArray" from the Lutana NVSE Plugin. It returns an array containing all forms of a certain type code, so passing 40 would be weapons. By default it returns forms from all used mods but you can refine it by passing an index.

 

I have a pretty simple script which enforces a repair limit like Fallout 3 which I wrote for JSU. If I can perfect it, I'll post it here so you can reuse it.

Edited by PushTheWinButton
  • Recently Browsing   0 members

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