I've written my script to activate my world map pin on a plot event. When I compile it says "Parsing variable list" on line 9 which is the "void main () line." Can someone look this over and tell me what's up? I'm also not sure if I have the const string and everything else how it should be.
#include "plot_h"
#include "utility_h"
#include "wrappers_h"
#include "plt_ancient_elven_ruins"
const string MY_RUINS_PIN = "my_ruins_map2"
void main()
{
// deconstruct event
event evCurrent = GetCurrentEvent();
int nEventType = GetEventType(evCurrent);
int nPlotFlag = GetEventInteger(evCurrent, 1);
// common
object oHero = GetHero();
switch(nEventType)
{
case EVENT_TYPE_SET_PLOT:
{
int nNewValue = GetEventInteger(evCurrent, 2); // value to be assigned
int nOldValue = GetEventInteger(evCurrent, 3); // value currently assigned
switch(nPlotFlag)
{
case SENT_TO_DWARF:
{
// Activate way point
object oMapPinRoad = GetObjectByTag("my_ruins_map2")
WR_SetWorldMapLocationStatus(GetObjectByTag(MY_RUINS_PIN), WM_LOCATION_ACTIVE);
break;
}
case FOUND_DWARF:
{
break;
}
}
break;
}
}
}
Script for Activating Pin on World Map help needed
Débuté par
Sonmeister
, mai 31 2010 12:01
#1
Posté 31 mai 2010 - 12:01
#2
Posté 31 mai 2010 - 12:20
Note the ";" below:
const string MY_RUINS_PIN = "my_ruins_map2";
Also, you should probably use the constant that you declared in the body of the script (MY_RUINS_PIN instead of "my_ruins_map2"). Also, using the object that you declared would be good. The script should basically look like this:
[dascript]
#include "plot_h"
#include "utility_h"
#include "wrappers_h"
#include "plt_ancient_elven_ruins"
const string MY_RUINS_PIN = "my_ruins_map2";
void main()
{
// deconstruct event
event evCurrent = GetCurrentEvent();
int nEventType = GetEventType(evCurrent);
int nPlotFlag = GetEventInteger(evCurrent, 1);
// common
object oHero = GetHero();
switch(nEventType)
{
case EVENT_TYPE_SET_PLOT:
{
int nNewValue = GetEventInteger(evCurrent, 2); // value to be assigned
int nOldValue = GetEventInteger(evCurrent, 3); // value currently assigned
switch(nPlotFlag)
{
case SENT_TO_DWARF:
{
// Activate way point
object oMapPinRoad = GetObjectByTag(MY_RUINS_PIN);
WR_SetWorldMapLocationStatus(oMapPinRoad, WM_LOCATION_ACTIVE);
break;
}
case FOUND_DWARF:
{
break;
}
}
break;
}
}
}
[/dascript]
const string MY_RUINS_PIN = "my_ruins_map2";
Also, you should probably use the constant that you declared in the body of the script (MY_RUINS_PIN instead of "my_ruins_map2"). Also, using the object that you declared would be good. The script should basically look like this:
[dascript]
#include "plot_h"
#include "utility_h"
#include "wrappers_h"
#include "plt_ancient_elven_ruins"
const string MY_RUINS_PIN = "my_ruins_map2";
void main()
{
// deconstruct event
event evCurrent = GetCurrentEvent();
int nEventType = GetEventType(evCurrent);
int nPlotFlag = GetEventInteger(evCurrent, 1);
// common
object oHero = GetHero();
switch(nEventType)
{
case EVENT_TYPE_SET_PLOT:
{
int nNewValue = GetEventInteger(evCurrent, 2); // value to be assigned
int nOldValue = GetEventInteger(evCurrent, 3); // value currently assigned
switch(nPlotFlag)
{
case SENT_TO_DWARF:
{
// Activate way point
object oMapPinRoad = GetObjectByTag(MY_RUINS_PIN);
WR_SetWorldMapLocationStatus(oMapPinRoad, WM_LOCATION_ACTIVE);
break;
}
case FOUND_DWARF:
{
break;
}
}
break;
}
}
}
[/dascript]
Modifié par Craig Graff, 31 mai 2010 - 12:33 .
#3
Posté 31 mai 2010 - 12:52
Thanks Craig. I often get my constants and objects mixed and find myself having this issue. It's good to have some other eyes look things over.
Why is it that sometimes you need the extension and sometimes you don't when you make constants references for tags? (ie. .dlg, .utc., .itc.)
Why is it that sometimes you need the extension and sometimes you don't when you make constants references for tags? (ie. .dlg, .utc., .itc.)
#4
Posté 31 mai 2010 - 01:10
You never need the extension for tags, but you always need it for resources.
#5
Posté 31 mai 2010 - 02:00
OK, I'll remember that. Thanks. BTW, the script worked like a charm.
Modifié par Sonmeister, 31 mai 2010 - 02:00 .





Retour en haut






