Jump to content

Scripting questions that seem hard to find an answer to.


Recommended Posts

Hi I hope this Post becomes a handy place to put up questions and find answers to some questions that seem to allude those who are still learning how to use CS scripting, or other modding questions for that matter dealing with there creation. That being said I have two questions that no trying a multitude of typing different ways into google I have yet to find something either matching or similar to what I am looking for, to suite my needs.

 

1) What's the proper function to set the players Current amount of remaining Magicka? I do not want to change the players overall Magicka limit just the amount they have at there current disposal ( without just changing a spell cost) I am looking for a scripting solution for various different scripts for the most part I would like my infinite ammo bow to require magic depending on the cost of the arrow

 

2) If I use the GetCrossHairRef to set a Ref in a script ( example Ref Target) and then have the script use the moveto function on that Ref the name of that ref becomes stuck on screen until the crosshair looks at something else within touch range. is there a workaround for this?

 

3) is there a way to make inventory item invisible while in menumode yet keep them equipped on the player?

Edited by CountryRoberts
Link to comment
Share on other sites

1) I have not found anything that answers this question

 

2) I see plenty of stuff about using GetCrossHairRef but nothing on the bug I mentioned

 

3) I have Tried to make my sneak boots with the Activator item being invisible if the player opens there menu. I have not found anything yet. I made a pair of boots that cast a long lasting Chameleon spell on the player via a trigger and it works and dispels if the player is no longer sneaking, however once activated all future quests no longer move to the nest stage without sneaking and leaving sneak mode, so the best solution I could think of is have an item capable of being equipped but that would not appear in the players inventory should they check.

Link to comment
Share on other sites

1. ModAV2. Or ModAVMod Magicka damage, which is essentially the same thing.

 

2. That's a tricky one. What I would probably do is hide the UI element using SetMenuFloatValue command. The path to menu element could be different depending on UI mod used, if any.

 

3. Set item as non-playable? I did not understand the part about having Chameleon and not updating quests, however.

Link to comment
Share on other sites

2. If you find a solution for that one, it would have been great but I am so used to it now, that it does not bother me any longer but it did not appeared until I started to use Midas spells, turning the mobs into gold. :) Now the targetname can get stuck at anything but as soon as I target something else, it disappears. But it does not get stuck all times as it is very random.

Link to comment
Share on other sites

3) Non-playable items cannot be equipped or seen, which makes your exact needs kinda useless. However, you can instead use what modders called "tokens" which are non-playable items added to the player that have a script attached to them. They're kinda weird, but you can basically use this a "watch" script to see if the player is sneaking or not. A better option is a quest script that runs continuously and only updates with an event handler as to not bog down the game. This would probably be the better script option, its why tokens ended up going away

Link to comment
Share on other sites

2) GetCrosshairRef is very weird and I've experienced similar issues as you. You need to flush out the reference variable immediately after you're done, it doesn't do it automatically. Its very wonky and not a good function overall, so limit its use if possible

Link to comment
Share on other sites

2. If you find a solution for that one, it would have been great but I am so used to it now, that it does not bother me any longer but it did not appeared until I started to use Midas spells, turning the mobs into gold. :smile: Now the targetname can get stuck at anything but as soon as I target something else, it disappears. But it does not get stuck all times as it is very random.

 

Yeah It is random, I have noticed that when this bug appears in my Ovad's Quicker Looting Mod, that the name gets stuck more often if I activate the Rings Looting Capabilities that use the moveto on dead bodies more often if I never opened the targets inventory before using.

If I open the Targets inventory to see what's inside close it without taking anything and then using it the bug happens less often around 2/10 uses. this lead me to believe the issue was regarding time so I used it while not moving and was stopped for a second or two while the intended target was in my Crosshair, this also seemed to have a much lower bug chance.

2) GetCrosshairRef is very weird and I've experienced similar issues as you. You need to flush out the reference variable immediately after you're done, it doesn't do it automatically. Its very wonky and not a good function overall, so limit its use if possible

I have the ref variable named harvest in my script that has this bug at the very end of each use it sets harvest to 0, this does nothing to minimize or fix the said bug.

Edited by CountryRoberts
Link to comment
Share on other sites

1. ModAV2. Or ModAVMod Magicka damage, which is essentially the same thing.

 

2. That's a tricky one. What I would probably do is hide the UI element using SetMenuFloatValue command. The path to menu element could be different depending on UI mod used, if any.

 

3. Set item as non-playable? I did not understand the part about having Chameleon and not updating quests, however.

 

1) doesn't seem like a solution as it would cause a change in the Total amount of Magicka a player can have either up or down, bypassing the Magicka recharge.

 

unless it needs to be followed up by combining a timer, GetAV, and ModAv2 or ModAvMod

or am I using this function incorrectly?

 

2) am still investigating

 

3) wouldn't work as shown here

 

 

3) Non-playable items cannot be equipped or seen, which makes your exact needs kinda useless. However, you can instead use what modders called "tokens" which are non-playable items added to the player that have a script attached to them. They're kinda weird, but you can basically use this a "watch" script to see if the player is sneaking or not. A better option is a quest script that runs continuously and only updates with an event handler as to not bog down the game. This would probably be the better script option, its why tokens ended up going away

Edited by CountryRoberts
Link to comment
Share on other sites

1. No, functions I mentioned do not change the max Magicka. Using Player.ModAV2 Magicka -100 is the same as casting a spell with 100 magicka cost.

 

3. Non-playable items can be equipped using EquipItem command, for example. I don't fully understand what you're trying to achieve though, so maybe my advice is not relevant at all.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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