Home › Forums › Mods and POG Scripting › Bad syntax in for loop?
- This topic has 0 replies, 1 voice, and was last updated 18 years, 11 months ago by JT.
-
AuthorPosts
-
4. December 2005 at 2:26 #14829JTParticipant
I spent the better part of yesterday tweaking the Torn Stars suite files to include some of my more-favourite themes from Freelancer. When I tested the revised suites in the game, they worked great: the Ambient music played just like it should have (the Alcuin system meshes pretty well with the Rheinland theme, I figure). However, the Tension and Action music didn’t play when I decided to go test out that feature by pissing off the locals quite royally.
I reviewed the source code of Torn Stars to discover why: the tMusic package provides basic support for combat music, but has no functionality to actually start it!
As an enterprising Canadian (read: exceedingly bored), I figured it was my very duty to write a package of my own to patch in this ability. TS_Combat_Music_JT was born.
However, I’m running into a wall. I’ve gotten the Pog SDK set up nicely, and have been trying to ram a pretty nice chunk of code into it. Unfortunately, PC doesn’t like my for loop.
Does anyone have any ideas what’s going on? My syntax looks fine to me. If it were walking down the street, I’d even give it a wolf whistle.
//miscellaneous irrelevant code snippedtask monitor_environment()
{
hship player = iShip.FindPlayerShip();
hship ship;
int i;
int restart;
set ships;
list player_fleet;
float delay_time;while(1) {
//Do we have hostiles?
ships = iSim.PlayerHostilesInRadius(100km, TM_Ship);if(Set.ItemCount(ships)) {
//Check every ship in the fleet to see if it has been attacked
player_fleet = Global.List("g_epic_fleet_player_list");//If the fleet hasn't been loaded yet, we'll wait a couple of
// seconds and then try again.
if(List.IsEmpty(player_fleet)) {
Task.Sleep(Task.Current(), 2.0);
continue;
}for(i = 0; i < List.ItemCount(player_fleet); i++) { // ***LINE 68*** ship = List.GetNth(i); ...
D:Jeremygamessimulationiwar2TornStarsTS_Combat_Music_JT.pog(68) : Error: Syntax error("i")
_______________
"The art of flying is to throw yourself at the ground and miss." --Douglas Adams
_______________
[i]Surgeon-General’s Warning: Early test cases of Torn Stars have resulted in fatalities. The errors in the software should be gone by now. Hopefully.[/i]
-
AuthorPosts
- You must be logged in to reply to this topic.