I am attempting to build a script that fires from a plot point attached to a background to shunt players with different backgrounds into various starting locations. Aside from the advisability of this (if anyone knows of a better way, please let me know!) I can't seem to get either DoAreaTransition or UT_DoAreaTransition to work properly.
#include "utility_h"
void main(){
void UT_DoAreaTransition(
string starting_area,
string starting_point
)
}
Am I doing something wrong?
Unknown state in compiler?
Débuté par
Idabrius
, févr. 13 2010 11:39
#1
Posté 13 février 2010 - 11:39
#2
Posté 13 février 2010 - 11:42
no 'void' before UT_DoAreaTransition
#3
Posté 13 février 2010 - 11:46
You also can't declare your string values at the same time you call on them (and you aren't assigning a value). It looks like you are trying to use them as string literals. This should be:
#include "utility_h"
void main()
{
UT_DoAreaTransition("starting_area", "starting_point");
}
Modifié par Craig Graff, 13 février 2010 - 11:46 .
#4
Posté 13 février 2010 - 11:57
Excellent, thank you. It compiles wonderfully. Of course, if anyone knows of a more efficient way of determining new background starting areas...
#5
Posté 14 février 2010 - 12:23
if only all errors were this easy to solve
#6
Posté 14 février 2010 - 01:52
I clearly don't grasp the scripting language very well -- ramping up the complexity of the script (since having it call when the right background plot is set doesn't seem to work) I have attached it to a "routing area" where all characters hopefully start in and then get bumped to their proper starting areas.
This is what I BELIEVE the script should look like. The toolset disagrees.
#include "utility_h"
#include "plt_sa_000pt_backgrounds"
#include "wrappers_h"
#include "events_h"
#include "global_objects_h"
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
int bEventHandled = FALSE;
switch (nEventType)
{
case EVENT_TYPE_AREALOAD_SPECIAL:
{
if (!WR_GetPlotFlag(PLT_sa_000pt_backgrounds, SA_GEN_BACK_TOWER_RAISED))
{
UT_DoAreaTransition("starting_area", "starting_point");
}
}
}
}
This is what I BELIEVE the script should look like. The toolset disagrees.
#include "utility_h"
#include "plt_sa_000pt_backgrounds"
#include "wrappers_h"
#include "events_h"
#include "global_objects_h"
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
int bEventHandled = FALSE;
switch (nEventType)
{
case EVENT_TYPE_AREALOAD_SPECIAL:
{
if (!WR_GetPlotFlag(PLT_sa_000pt_backgrounds, SA_GEN_BACK_TOWER_RAISED))
{
UT_DoAreaTransition("starting_area", "starting_point");
}
}
}
}
#7
Posté 14 février 2010 - 02:00
Idabrius wrote...
This is what I BELIEVE the script should look like. The toolset disagrees.
Hm. The language is case sensitive, so maybe the "PLT_sa_000pt_backgrounds" bit which should prolly be in uppercase. But you should get a compiler error message hinting you right away to the right (well, more like the wrong) line. Most of the time.
#8
Posté 14 février 2010 - 02:37
Once again, the assistance of the boards proves perfect and undeniable. YET, the script does not move characters based on background flags as I had hoped it would, which frustrates me.
#9
Posté 14 février 2010 - 02:41
EDIT: Solved. Issue with the format I was using. For future reference, the !WR_GetPlotFlag does something OTHER than what I was looking for. Anyone who hits this issue might consider if (WR_GetPlotFlag(PLT_PLOT, FLAG_NAME) == TRUE) instead.
#10
Posté 14 février 2010 - 03:14
The ! in front of any expression logically inverts the expression's result.
The following statements are equivalent:
if (WR_GetPlotFlag(...))
if (WR_GetPlotFlag(...) == TRUE)
if (WR_GetPlotFlag(...) != FALSE)
Also, the following are equivalent
if (!WR_GetPlotFlag(...))
if (WR_GetPlotFlag(...) == FALSE)
if (WR_GetPlotFlag(...) != TRUE)
You can see where this is going
Ciao, muh!
The following statements are equivalent:
if (WR_GetPlotFlag(...))
if (WR_GetPlotFlag(...) == TRUE)
if (WR_GetPlotFlag(...) != FALSE)
Also, the following are equivalent
if (!WR_GetPlotFlag(...))
if (WR_GetPlotFlag(...) == FALSE)
if (WR_GetPlotFlag(...) != TRUE)
You can see where this is going
Ciao, muh!





Retour en haut






