Control waypoints from script.

This commit is contained in:
Steve 2016-03-12 12:09:42 +00:00
parent 4f19dcb9a5
commit ae6e2ede09
9 changed files with 38 additions and 4 deletions

View File

@ -8,7 +8,7 @@
"manualComplete" : 1,
"objectives" : [
{
"description" : "Check all wayponts",
"description" : "Check all waypoints",
"targetName" : "Waypoint",
"targetValue" : 5,
"targetType" : "TT_WAYPOINT"
@ -42,6 +42,12 @@
}
],
"script" : [
{
"function" : "TIME 0",
"lines" : [
"ACTIVATE_NEXT_WAYPOINT"
]
}
{
"function" : "Waypoint #2",
"lines" : [

View File

@ -59,6 +59,12 @@
}
],
"script" : [
{
"function" : "TIME 0",
"lines" : [
"ACTIVATE_NEXT_WAYPOINT"
]
},
{
"function" : "Waypoint #3",
"lines" : [

View File

@ -45,6 +45,12 @@
}
],
"script" : [
{
"function" : "TIME 0",
"lines" : [
"ACTIVATE_NEXT_WAYPOINT"
]
},
{
"function" : "TIME 3",
"lines" : [

View File

@ -126,6 +126,12 @@
}
],
"script" : [
{
"function" : "TIME 0",
"lines" : [
"ACTIVATE_NEXT_WAYPOINT"
]
},
{
"function" : "Waypoint #2",
"lines" : [

View File

@ -126,6 +126,12 @@
}
],
"script" : [
{
"function" : "TIME 0",
"lines" : [
"ACTIVATE_NEXT_WAYPOINT"
]
},
{
"function" : "Waypoint #1",
"lines" : [

View File

@ -213,6 +213,10 @@ static void executeNextLine(ScriptRunner *runner)
{
battle.jumpgate->systemPower = MAX_SYSTEM_POWER;
}
else if (strcmp(command, "ACTIVATE_NEXT_WAYPOINT") == 0)
{
activateNextWaypoint(0);
}
else if (strcmp(command, "MSG_BOX") == 0)
{
sscanf(line, "%*s %255[^;]%*c%255[^\n]", strParam[0], strParam[1]);
@ -273,6 +277,8 @@ void destroyScript(void)
if (scriptJSON)
{
cJSON_Delete(scriptJSON);
scriptJSON = NULL;
}
while (head.next)

View File

@ -35,6 +35,7 @@ void activateObjectives(char *objectives);
extern int showingMessageBoxes(void);
extern char *getTranslatedString(char *string);
extern void spawnScriptFighter(char *fighters, char *side, int num, char *location);
extern void activateNextWaypoint(int id);
extern Battle battle;
extern Colors colors;

View File

@ -216,8 +216,6 @@ void loadMission(char *filename)
battle.status = MS_IN_PROGRESS;
}
activateNextWaypoint();
countNumEnemies();
initPlayer();

View File

@ -35,7 +35,6 @@ extern void stopMusic(void);
extern void initPlayer(void);
extern long flagsToLong(char *flags, int *add);
extern Entity *spawnWaypoint(void);
extern void activateNextWaypoint(void);
extern void selectWidget(const char *name, const char *group);
extern Entity *spawnJumpgate(void);
extern Entity *spawnItem(char *type);