Jump to content

Is this possible?


JustynThyme

Recommended Posts

I am new to modding. I just want to get that out of the way up front. Despite that, I try to do everything I can to figure out what I am trying to do on my own. Yeah, this is my first mod, so I don't exactly have a track record to support this statement. I just have an evidence-free reassurance that I have spent five days trying to figure this out, pouring over the GECK website, searching forums, doing/reading/watching tutorials, and massive amounts of trial-and-error.

 

I am trying to create a very small mod, with a rational explanation. I want to create a consumable item that sets all SPECIAL stats to 10 and all skills to 100 on use, not on pickup. I want to use the Med-X consumable item as my base, because I want this consumable to be a syringe that shows up in your inventory on the Aid page after picking it up. The flavor idea behind this item is that it is the last treatment in a nine-year eugenics gene-therapy battery (official Vault duties aren't the only thing you started when you turned 10!). This last treatment will trigger everything that has been changed over the last nine years. Your father gave it to you before you took the GOAT, and told you to use it when you are ready, giving you the option to never use it at all. I want the player to have the ability to hold onto the item, even placing it into a container and retrieving it later, until they decide to use it later, if they ever do.

 

The first thing I tried was copying the Morphine item, and changing the effects to "Increase<stat name>" and "IncreaseSkill<skill name>" for each stat and skill, changing the duration to "0 s" - which is supposed to make it permanent. This did not work. It does work if I make it temporary, but not if I set the duration to "permanent". The part about this that confused me was that the "Increase<stat name>" and "IncreaseSkill<skill name>" effects with a "0 s" duration is what the bobbles use, so the effects should work. But they didn't even work on pickup. One problem I have with this method, if it worked, is that I can't tell where the stat or skill started, so how much to add might be an issue. Since it didn't work, I can't tell if this is even an issue.

 

The next thing I tried was copying the Morphine item, removing all effects, and setting the item to use a script (Player.SetAv specifically). What I am having a problem with here is finding a blocktype that is triggered when the item is used. I see "OnActivate", but that just made the effects trigger on pickup, not on use. I tried "OnEquip" and "OnActorEquip", but they just failed. I'm assuming it's because they aren't designed to be used with consumables, or something like that. It's frustrating that there isn't an "OnUse" blocktype. :)

 

So, my questions are these: Is it possible to make a consumable that permanently changes stats and skills (without knowing the values they are currently at)? If so, what am I missing? Thanks in advance for your time and help. :)

Link to comment
Share on other sites

Have you tried using player.forceav instead of player.setav?

 

In my limited experience with scripting I have found that .setav lasts only while the game is open but will revert back to the "default" values when you leave the game and try to reload from a save. Then again I often have no clue what I am doing and this could have been casued by something else entirely.

 

Anyways, just a thought and best of luck.

Link to comment
Share on other sites

Have you tried using player.forceav instead of player.setav?

 

In my limited experience with scripting I have found that .setav lasts only while the game is open but will revert back to the "default" values when you leave the game and try to reload from a save. Then again I often have no clue what I am doing and this could have been casued by something else entirely.

 

Anyways, just a thought and best of luck.

 

Thanks for the suggestion. According to the GECK Wiki, ForceAV affects the current stat, and might have different results at different times (if I'm reading it correctly). SetAV changes the base value for the stat, so I think Set is what I want to use, not Force. But, since the point of me coming to the community for help, I gave it a shot. The result was exactly the same as before. The stats changed on pickup, not on use.

 

I believe the problem lies in the blocktype. I'm not seeing a blocktype that is triggered when the item is used from the inventory (on use) instead of on activation of the item (on pickup). Thanks again!

Link to comment
Share on other sites

A couple of things:

 

On your first attempt, the 'Base Effect' of Increased [whatever] all have the 'Recover' flag set and the 'No Duration' flag un-checked, which means the effect wears off and you were setting it to wear off after 0 seconds. You would have to make your own Base Effects that don't have the 'Recover' flag set and instead, have the 'FX Persist' & 'No Duration' flag set. That would make them permanent.

 

In your second attempt with the effect script, you can ONLY use three block types;

ScriptEffectStart - which runs once when the effect starts

ScriptEffectUpdate - which runs every frame while the effect is in effect

ScriptEffectFinsh - which runs once when the effect ends

 

And the script itself needs to be an effect script as defined by the dropdown box at the top of the script window.

 

 

Also, I think its best to stay away from ForceAV all the times and only use SetAV in very special circumstances (like with Aggression and Confidence). Its better to use ModAV. Or in this case, I would use DamageAV and RestoreAV. Using the last two commands allows you to reset the original values without having to store their values. DamageAV can add to a stat skill by passing a negative value, and these commands don't affect the original actor values. Using ForceAV and SetAV can have adverse affects later on, like when leveling up.

 

Another way to do this would be to make a perk that adds the skill/stats to the player's values. Thus removing the perk would set the player back to his original form without so much as one 'Player.RemovePerk [PerkName]' command.

Link to comment
Share on other sites

I think that pkleiss is on target with his recommendations. What about modpcs for skills?

 

On a side note: most players who are interested in god items (like an instant, permanent increase of all stats and skills to maximum) are familiar enough with console commands to achieve the same ends without downloading a mod.

Link to comment
Share on other sites

both pkleiss and badpenny are right. i didn't see you mentioning the magnitude for each skill/stat but i'm assuming that you set those on 100 and 10 for each of them. i made this way an activator that let's the player walk faster using the bullet time mod. so it is even possible to use the item several times instead of 1 time only.
Link to comment
Share on other sites

pkleiss:

 

Thanks for the suggestions. I had thought about creating my own base effects earlier, but got distracted with trying other things first, to the point where I had forgotten I was going to try this. I gave it a try, though, and it didn't work. I'm not sure why. Do you think *how* I tried this would matter? I copied the Increase<stat name> effect and made my changes, renamed it, and used that instead. As I said, it didn't work - which was disappointing, because your suggestion sounded like it *should* have worked. :/

 

For my scripting attempt: Aha! I knew I had it wrong! Okay, so I looked at those blocktypes, and it looks like I can use ScriptEffectStart by itself, since I don't want the effect to end. I tried it out, though, and it also didn't work. I might have done it wrong. Here is my test script:

 

scn FinalEugenicsTreatment

 

ref rUser

 

Begin ScriptEffectStart

if rUser.GetIsReference player

Player.SetAV Strength 10

endif

End

 

I also triedjust this:

 

scn FinalEugenicsTreatment

 

Begin ScriptEffectStart

Player.SetAV Strength 10

End

 

Also, when I mark the script as an effect, it won't show up for use for the item I was making. So, I tried it as an object just to see, and it didn't work.

 

From what I have read, during leveling up, having a skill past 100 won't mess anything up. The additional points will be kept track of in case of effects that will lower the skill (so if a skill is at 114, and an effect has a -14 penalty, you are still operating at full capability). Also, from what I read, if a stat is at 10, adding to it does nothing (as evidenced by acquiring a Bobblehead when your score is already 10). If you don't mind me asking, what difficulties were you referring to?

 

I had considered a perk. The reason I scrapped the idea was because I wanted this mod to be able to be activated at any time, not just at leveling up. Although, now that I write that, I suppose I could apply the perk when the item is used, and I like that idea better than what I have been trying (a perk would allow flavor text to remain after use of the item). However, using a perk would depend on my figuring out how to get the desired effect to apply on use instead of on pickup.

 

BadPenny:

 

I am aware that anyone interested in this mod would already be familiar enough with console commands to just use them instead of installing this mod. That's not really the point of my mod, though. As I said, I'm learning, and I thought this would be a good place to start. I had originally planned on getting this to work, then maybe adding a menu that would allow the player to set how high the stats were adjusted. Also, console commands are a bit clunky. Having an item that would do it all at once is more efficient. Plus, console commands don't have a story attached to them, so they are less interesting and fun.

 

deepside: First line of the second paragraph of the original post: "...and set all skills to 100 on use."

 

 

 

Thanks for the input, everyone. :)

Link to comment
Share on other sites

Look at this pic from the Geck. There was a lot of data pages, so I hope you can follow my explanation.

 

I wanted to make an apple, that when eaten, permanently raises the player's Health. I also wanted a few apples such that eating each one raised the player's Health permanently again cumulatively. I had to do this via a perk because when using straight Actor Effects that used ModAV, what would happen is that the player's max Health and current Health (if full) would not match - since ModAv doesn't effect the player's Max health stat, only his Current Health . A further problem was that the player's health became permanently locked and would not increase at the level up screen. This is the problem with using SetAV, you can't change it anymore with other events that happen in the game. You don't want that. So a perk with three levels was the way to go.

 

In my picture, you can see that I start with an Ingestible (The Apple) that applies a Base Effect called 'Add Apple Perk'. Note the flags for this Base Effect. The Base Effect uses an Effect Script called 'UCAppleEffectScript'. Note that the archetype is set to script. This must be done if using a script for the effect. Other settings that are used commonly are: Value Modifier (to modify a stat/skill) and Value and Parts (to modify a stat and associated body parts) (see this).

 

The effect script (which is defined as an Effect script because it is used by a Base Effect and not by an Object or Quest), simply adds the perk 'UCApplePerk' to the player and shows a message to the player that he has eaten the apple and feels a rush of energy. The Ref statement in there is a left-over that has no use, so ignore it.

 

The Perk, 'UCApplePerk'' is flagged as Playable (so the player can use it) and Hidden (so it won't show up on the level up screen) and has three ranks that correspond to eating three apples. The first time you eat an apple you get rank 1, the second gives you rank 2, etc... You can see that each rank gives the player a different Ability. I only showed one of these 'Abilities' but the other two are similar, they just give more Health (20, 40, 60 respectively). Note that each rank has a Type and Data. These are Actor Effects that are set to the 'Ability' Type. The 'Data' just refers to the Actor Effect to apply.

 

The one Actor Effect I showed uses the vanilla 'Increased Health' Base Effect with a magnitude of 20 that I input. The other two not shown are identical except for the magnitude. Even though the Base Effect of Increased Health has the recover flag set, since its being called from a perk which is permanently applied to the player (until such time as a RemovePerk command is called) the effect is permanent.

 

You don't have to do it this way, but this really shows all the parts you have been trying and how they should work together. So mix and match to your liking but follow the example setup for any part.

 

I hope I have helped and not confused you.

Link to comment
Share on other sites

Look at this pic from the Geck. There was a lot of data pages, so I hope you can follow my explanation.

 

I wanted to make an apple, that when eaten, permanently raises the player's Health. I also wanted a few apples such that eating each one raised the player's Health permanently again cumulatively. I had to do this via a perk because when using straight Actor Effects that used ModAV, what would happen is that the player's max Health and current Health (if full) would not match - since ModAv doesn't effect the player's Max health stat, only his Current Health . A further problem was that the player's health became permanently locked and would not increase at the level up screen. This is the problem with using SetAV, you can't change it anymore with other events that happen in the game. You don't want that. So a perk with three levels was the way to go.

 

In my picture, you can see that I start with an Ingestible (The Apple) that applies a Base Effect called 'Add Apple Perk'. Note the flags for this Base Effect. The Base Effect uses an Effect Script called 'UCAppleEffectScript'. Note that the archetype is set to script. This must be done if using a script for the effect. Other settings that are used commonly are: Value Modifier (to modify a stat/skill) and Value and Parts (to modify a stat and associated body parts) (see this).

 

The effect script (which is defined as an Effect script because it is used by a Base Effect and not by an Object or Quest), simply adds the perk 'UCApplePerk' to the player and shows a message to the player that he has eaten the apple and feels a rush of energy. The Ref statement in there is a left-over that has no use, so ignore it.

 

The Perk, 'UCApplePerk'' is flagged as Playable (so the player can use it) and Hidden (so it won't show up on the level up screen) and has three ranks that correspond to eating three apples. The first time you eat an apple you get rank 1, the second gives you rank 2, etc... You can see that each rank gives the player a different Ability. I only showed one of these 'Abilities' but the other two are similar, they just give more Health (20, 40, 60 respectively). Note that each rank has a Type and Data. These are Actor Effects that are set to the 'Ability' Type. The 'Data' just refers to the Actor Effect to apply.

 

The one Actor Effect I showed uses the vanilla 'Increased Health' Base Effect with a magnitude of 20 that I input. The other two not shown are identical except for the magnitude. Even though the Base Effect of Increased Health has the recover flag set, since its being called from a perk which is permanently applied to the player (until such time as a RemovePerk command is called) the effect is permanent.

 

You don't have to do it this way, but this really shows all the parts you have been trying and how they should work together. So mix and match to your liking but follow the example setup for any part.

 

I hope I have helped and not confused you.

 

:woot: Confused? Not at all! Actually, this helped a LOT. I followed your example and got my mod to work. Thanks a lot, man. You put a lot of effort into helping me, and I appreciate it. This really drives home that there's much more involved than what you would think. :)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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