Jump to content

I have some Scripting Questions


mogbert

Recommended Posts

Having some trouble with scripting in the game, particularly with references.

How can I reference what weapon I'm carrying? The armor I'm wearing?

I would like to be able to tell the health of the armor I'm wearing. I found a specific command to tell the condition of the weapon I have equipped (GetWeaponHealthPerc) but nothing similar for armor.

Or if I already know the reference, how do I tell the condition of a piece of armor? How do I tell the amount of ammo I have left for the equipped weapon? I'm more used to object oriented programming, so I keep thinking I should be looking at the persistent references properties...

 

Also, when you put a skill bonus on a piece of armor, as an enchantment, it get's added to the temp pool for that skill. But so far I can only find script commands that add stats permanently. How can I script TEMPORARY skill bonuses, so that I can remove them in the scripting and restore it to a state prior to the script running? For example, if I want to add 5 strength at one point then remove 5 strength. If he already has 8 strength, then adding 5 will take him to 10, then removing 5 would take him to 5 instead of 8 again. Or does it not work that way? I can't store it in a temp variable, I think, because the game might be saved and closed (do temp variables that you declare in a script get saved?). If I can't do it fairly easily, I may just add the extra skill as an ability, then remove the ability when I'm done (like the Magic 8Ball script). I think that would only effect the temp pool.

Link to comment
Share on other sites

i cant answer most of that post, but for scripting TEMP skills use the Float prefix.

 

SCN YOURSCRIPT

Begin OnActivate
Float THISSKILLNAME

Player.addspell PERKNAME (maybe not addspell, maybe Addperk? ive not done this since Oblivion)

   endif
end

 

then you need a script to deactivate you're "Float" and then remove the spell/perk

 

best bet would probly be an "OnEquipt player ITEMID" followed by an "OnUnEquipt player ITEMID" one but it "should" also work with float commands. try the GECK wiki for block referances and the correct syntax

Link to comment
Share on other sites

For sake of argument, let's say that I wanted a script where your house bot would say something if your armor was below 50% condition, just like he says something when you come back wounded. Then I wanted to script a repair happening, even if it was based on your own ability and only worked on one persistant reference.

1. How would I do that?

2. How do vendors repair an object?

3. Is that scripted or part of the program?

I'm at work right now and can't try anything, but I have a three day weekend coming up and want to get this out the door.

Link to comment
Share on other sites

OK, I found how to do all the stat and skill bonuses in the temp pool.

 

One problem. When I level up, it says I have -293 skill points to assign.

I'm pretty sure the problem can be fixed via setting the sLevelUpSkillCounter.

 

Ho do you set the sLevelUpSkillCounter. It is an object type of "Game Setting." A google search returns no hits. I need to reset it to like, 23 or something.

 

This page seems related: http://geck.bethsoft.com/index.php/Settings

 

But so far, while it lists them and talks about changing them, I don't see anywhere where it actually shows HOW to change them.

 

Also, the 's' indicates it should be a string, but I would have expected a number.

 

EDIT!!!

 

OK, found a new solution that MIGHT work, but for it to work, I need to be able to "Get" the Player's current level. I'm surprised but it looks like it isn't one of the ActorValues. How do you find the current level of the player?

 

EDIT TWO!!!

 

Sorry, silly me, GetLevel didn't show up when I searched :-P.

 

-----------------

 

OK, back to needing to know how to modify the "Health" of a piece of armor of which you already know the persistent reference of.

Link to comment
Share on other sites

OK, my previous fix didn't work, and it had other flaws. So now I need to see how did the game keep you from leveling up until after you left the vault?

I've checked out the quests CG04 (Escape) and MQ01 (Following In His Footsteps). I didn't see anything that was released that let you level up as soon as one finished and the other started.

 

This shouldn't be too hard, it was just something that stopped the leveling process, but let you level up as soon as it was removed. I need that command/function.

 

I'll be looking for it through the GECK as well, but any help would be appreciated.

 

EDIT!

 

SetInCharGen 1 stops leveling! 0 starts again. Sorry, sometimes I need a place to ask questions when I don't think I'll find the answer, but I keep looking anyway. Sometimes I eventually find the answers.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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