Jump to content

I Need Some Scripting Help.


odark

Recommended Posts

I'm about at my witt's end with this script I've been writting for my modified Adoring Fan mod. I basically made the Adoring Fan Essential, I would like it that when he is knock unconscious than he does a resethealth command when he goes to get back up. So I tried this in a script running on him? What am I doing wrong? I've gone to the WIKI, but it's hard to learn from that site when you don't know what you're looking for to begin with...

 

If(ArenaFan1.GetUnconscious)

ResetHealth

EndIf

 

I'd also like to add another If statement that keeps the player from pickpocketing the Adoring Fan, but I have no idea what to look for in that respect.

 

The next problem I'm having has to do with the equipment in my mod. I've made it so the adoring fan levels with you and self upgrades equipment, but the script keeps giving him the same equipment whenever it changes state. So for example the quest runs the script that tells it to...

 

If(Player.GetLevel >= 1)

ArenaFan1Ref.AddItem IronBoots 1

ArenaFan1Ref.EquipItem IronBoots 1

EndIf

 

But I sneak on the fan and see 30 or more boots on him. I'd like it so that he only spawns one set and it doesn't degrade from use, any ideas? I'm new to scripting so any help would be great. (And if you are wondering, yes I had to learn how to do If statements from looking at other peoples mod's that accomplished 'like' tasks that I wished to accomplish. But my search has lead me to no good conclusions on the above issues.)

 

Can anyone help me out?

Link to comment
Share on other sites

I don't have a clue on the unconscious thing, but on the equipment, you have a logic problem. As it is now, your script tests whether the player's level is greater than or equal to 1. Since the players level will ALWAYS be greater than or equal to 1, this condition will always evaluate TRUE and will add the iron boots. My recommendation would be to change it to "If Player.GetLevel == 1". That way, as long as the script only runs once per level, the condition will only be true one time. Add a similar test for each level you want equipment changed and you should be good.

 

Mez

 

PS - My example doesn't take into account the fan dying and respawning without the added equipment. That will require additional testing.

Link to comment
Share on other sites

Seems when I use == it doesn't check at all. I player.setlevel 30 as soon as I got in, which should have ran my

 

If(Player.GetLevel >= 30)

ArenaFan1Ref.SetLevel 30

EndIf

If(ArenaFan1Ref.GetItemCount EbonyBoots >= 1 && Player.GetLevel >= 30)

ArenaFan1Ref.RemoveItem EbonyBoots 1

ArenaFan1Ref.AddItem DaedricBoots 1

ArenaFan1Ref.EquipItem DaedricBoots 1

EndIf

 

So on and so on... But it didn't? Man, this is really crushing my brain lol.

Link to comment
Share on other sites

Hey, sorry I haven't replied sooner (I missed your response). Are you still having problems with this? If so, are you sure the script is executing when you expect it to? A quick way to test is to add a "messagebox" to it so that you get visual confirmation.

 

I've done very little scripting but what you posted seems to make sense. I assume you have all of this inside a "Begin GameMode"?

 

Anyway, let me know if you still need help. If so, I may work on it some this weekend.

 

Mezlo

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...