Aller au contenu

Photo

Weird Error with script "Variable defined without type"


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
Alexandus

Alexandus
  • Members
  • 438 messages
I've been getting an error with a script of mine that I can't seem to get rid of, here's the script:
And the error is "Variable defined without type", at line 22 that I'll highlight below.

#include "utility_h"  
#include "events_h"
#include "global_objects_h"

void main()
{
    event ev = GetCurrentEvent();
    int nEventType = GetEventType(ev);
    switch(nEventType)
    {
        case EVENT_TYPE_UNIQUE_POWER:
        {
            object oItem = GetEventObject(ev, 0);
            string book = "specbook";
            string name;
            name = GetTag(OItem);
            object oCaster = GetEventObject(ev, 1);
            if (name == book)  //this is where the "Variable not defined" error occurs.
            {
             SetCreatureProperty(oCaster, 38, 1.00);
            }
            break;
        }
    }
}

#2
TimelordDC

TimelordDC
  • Members
  • 923 messages
The GetTag function has the wrong argument. It should be oItem instead of OItem.

#3
Alexandus

Alexandus
  • Members
  • 438 messages
*Facepalm* *Facepalm* *Facepalm* GAH! I knew it was something little like that!



Many thanks, you've saved me a lot of time and my computer from being stabbed with a pickaxe out of sheer frustration.