Aller au contenu

Photo

Unknown state in compiler?


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

#1
Idabrius

Idabrius
  • Members
  • 25 messages
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?

#2
Baracuda6977

Baracuda6977
  • Members
  • 353 messages
no 'void' before UT_DoAreaTransition

#3
Craig Graff

Craig Graff
  • Members
  • 608 messages
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
Idabrius

Idabrius
  • Members
  • 25 messages
Excellent, thank you. It compiles wonderfully. Of course, if anyone knows of a more efficient way of determining new background starting areas...

#5
Baracuda6977

Baracuda6977
  • Members
  • 353 messages
if only all errors were this easy to solve

#6
Idabrius

Idabrius
  • Members
  • 25 messages
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");

}

}

}

}

#7
Phaenan

Phaenan
  • Members
  • 315 messages

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
Idabrius

Idabrius
  • Members
  • 25 messages
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
Idabrius

Idabrius
  • Members
  • 25 messages
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
thebigMuh

thebigMuh
  • Members
  • 98 messages
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!