Problems with Script (when player gets object by keyword)

Post » Mon Jun 18, 2012 1:49 am

Scriptname BladesArmorMonitor extends Quest  ConditionalMessage Property pMessage1 Auto ConditionalMessage Property pMessage2 Auto ConditionalKeyword Property pArmor Auto ConditionalPerk Property pPerk Auto ConditionalQuest Property QSTBladesArmorMonitor Auto Conditionalevent OnInit()    ArmorCounted()    pMessage1.Show()endEventFunction ArmorCounted()    float CurrentCount = Game.GetPlayer().GetItemCount(pArmor)    if CurrentCount >= 1        Game.GetPlayer().AddPerk(pPerk)        pMessage2.Show()        GotoState("Done")    endifendFunction

That's the script I'm currently working on. When the player picks up one of a group of specific objects, I want him to automatically gain the perk required to craft more of those objects.

But ArmorCounted isn't firing properly. If I'm right in my scripting- and it's entirely possible I'm horribly, horribly wrong- my OnInit block (which IS firing properly, I scripted a debug message in to be sure) should be immediately firing my ArmorCounted block. But when I get an object with the proper keyword (which is set by properties, a new favorite feature of mine), I never get the second debug message, and I know the perk isn't added.

Any clue what's wrong, better programmers?
User avatar
NO suckers In Here
 
Posts: 3449
Joined: Thu Jul 13, 2006 2:05 am

Return to V - Skyrim