Jump to content

unknown user flag error


Recommended Posts

I'm starting on my first script for F4 coming from Skyrim.

here it is:

Scriptname dz_no_attacks_quest_script Extends Quest

Form FormFromOtherMod = Game.GetFormFromFile(0x0006F5C5, "Fallout4.esm") As Form

and it fails to compile with error:

Compiling "C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\dz_no_attacks_quest_script.psc"...
C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\dz_no_attacks_quest_script.psc(8,24): no viable alternative at input 'Game'
C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\dz_no_attacks_quest_script.psc(8,28): required (...)+ loop did not match anything at input '.'
C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\dz_no_attacks_quest_script.psc(8,5): Unknown user flag game

 

and I'm already defeated:)

Can anyone help? Am I making some sort of Skyrim learnt mistake?

 

diziet

Link to comment
Share on other sites

You can declare an object globally, but you can't call a function in the global scope of the script, you need to declare a function or event, and call the function there, for example,

 

if you want to use it globally, for many functions/events of the script, you can declare it globally and fill it in the init event, like this:

Scriptname dz_no_attacks_quest_script Extends Quest

Form FormFromOtherMod

Event OnQuestInit()
	FormFromOtherMod = Game.GetFormFromFile(0x0006F5C5, "Fallout4.esm")
EndEvent

Or you can declare and fill it only for the scope of a given function/event:

Scriptname dz_no_attacks_quest_script Extends Quest

Event OnQuestInit()
	Form FormFromOtherMod = Game.GetFormFromFile(0x0006F5C5, "Fallout4.esm")
EndEvent

Edited by DieFeM
Link to comment
Share on other sites

  • Recently Browsing   0 members

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