Aller au contenu

Photo

Need help with NPC in existing area script not compiling


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

#1
Sonmeister

Sonmeister
  • Members
  • 167 messages
I can't seem to get this script to compile.  I wanted to use it with the PRCSCR to add a quest giver to the single player game with my quest.  I used the template on the PRCSCR page to add a NPC to an existing area.  I keep getting this error message "No semicolon after expression" so when I remove the semicolon it still won't compile and I get the same message.  It's the semicolon at the end of this line (17).   WR_SetPlotFlag("ancient_elven_ruins", ADD_QUEST_GIVER_TO_CAMP,TRUE);



#include "plt_ancient_elven_ruins"
#include "wrappers_h"

void main()
{
    if(WR_GetPlotFlag(PLT_ANCIENT_ELVEN_RUINS, ADD_QUEST_GIVER_TO_CAMP)==FALSE)
    {
        object oTown=GetObjectByTag("ntb100ar_dalish_camp");//need area tag, not list tag
        vector vJobloLocation = Vector(258.816,233.474,6.57928);// May need to drop "f"

        CreateObject(
            OBJECT_TYPE_CREATURE,
            R"quest_giver_in_camp.utc",
            Location(oTown, vjobloLocation, 161.5)
        )

        WR_SetPlotFlag("ancient_elven_ruins",ADD_QUEST_GIVER_TO_CAMP,TRUE);
    }
}

#2
Mengtzu

Mengtzu
  • Members
  • 258 messages
You do need a semicolon after your CreateObject statement. Also you need to use the same capitalisation everywhere for variable names (eg vJobloLocation).

#3
Sonmeister

Sonmeister
  • Members
  • 167 messages
Thanks, I caught the vJobloLocation but not the other. Tried the semi colon after the CreateObject statement, but it doesn't seem to like that now.

#4
Mengtzu

Mengtzu
  • Members
  • 258 messages
Try your CreateObject on a single line?



CreateObject(OBJECT_TYPE_CREATURE, R"quest_giver_in_camp.utc", Location(oTown, vJobloLocation, 161.5));

#5
Sonmeister

Sonmeister
  • Members
  • 167 messages
That did it, thanks!

#6
Craig Graff

Craig Graff
  • Members
  • 608 messages
A statement doesn't have to be on a single line, of course. But it will often help you spot errors like putting the semicolon after the

Location(oTown, vjobloLocation, 161.5)

rather than after the ) on the next line.