Yes, it's a feature!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: strazer on Tue 29/08/2006 15:35:58If you define variables in the script header, separate variables are created for the global script and each room script. Changing the variable's value from within a room script thus doesn't affect any of the others.
To create a global variable that you can use outside the global script, you have to define it in the global script, export it and then import it into the script header:Code: ags // global script int catStat; export catStat;
Code: ags // main script header import int catStat;
// global script
int catStat;
export catStat;
// main script header
import int catStat;
Quote from: Radiant
No, because then it would be ambiguous what you actually clicked on: if two objects/characters/room hotspots were adjacent, and your cursor was partially over both of them, which of them are you clicking on?
Quote from: jet on Mon 28/08/2006 22:52:38I'm sure that the walkthrough page can be fixed or maybe the AGS wiki can be used.
// main global script
int MyTimer = -1; // define timer variable, initially off
export MyTimer; // export variable for use in room scripts
function repeatedly_execute() { // gets executed every game loop
if (MyTimer > 0) { // if timer is on
MyTimer--; // decrease timer by 1 game loop
YourGuiLabel.Text = String.Format("%d", MyTimer); // display its value on your gui label
}
else if (MyTimer == 0) { // aka IsTimerExpired
// do stuff
MyTimer = -1; // turn timer off
}
}
// main script header
import int MyTimer; // import variable for use in room scripts
// some script
MyTimer = 400; // aka SetTimer; 40 game loops = 1 second
Quote from: mchammer on Thu 24/08/2006 19:47:39*The game uses now Strazer's Character Control Module which
makes the game world much more believable.
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.227 seconds with 17 queries.