Demo switching missions code
by Edward · in Torque Game Engine · 01/02/2007 (2:14 pm) · 11 replies
I noticed that the Demos all switch missions if left alone for a few minutes. where is the code for this? please be specfic where the line of code is if you can. I want to stop it from switching so fast.
About the author
I am working on my first large Game with a team of programmers and artists. I am a avid gamer and am the lead producer and director of Fantasci Hidden War. I have my first published game credit with Chariots as a Level Designer and Interior Artist.
#2
// Game duration in secs, no limit if the duration is set to 0
$Game::Duration = 0; // AFX
this is the line i have, yet it still swapped missions.
01/02/2007 (2:56 pm)
Hmm ok, I need to make a point, i am using AFX. // Game duration in secs, no limit if the duration is set to 0
$Game::Duration = 0; // AFX
this is the line i have, yet it still swapped missions.
#3
01/02/2007 (3:12 pm)
Edward, have you been doing anything with scoring? or perhaps doing something that was scoring as a side-effect? In GameConnection::onDeath() in ~/server/scripts/game.cs, there is some code that looks like it would trip a mission recycle when someone reached a score of $Game::EndGameScore (which is 30 by default).
#4
01/02/2007 (3:28 pm)
Hi, jeff. Ok i on creating zones (AkA missions). Now the Demo cycles through the missions, but there appears to be a few code changes. I have altered the trigger.cs from launch mission to loadmission. And it calls for it as per normal. The console registers it as loading, stage 1 and stage2, then it crashes. I noticed that the demo still switched missions when i left it alone. and in game.cs, the time setting is 0 which according tothe note is no time limit and shouldnt have a game duration. Any ideas where that funtion is. since it doesnt appear to be in triggers and i dont really see any reference to the specified demo mission swapping script.
#5
01/02/2007 (3:59 pm)
Well the cycleGame() function in ~/server/scripts/game.cs seems to be a function that may cause a mission change. That's why I thought you may be causing it with scoring, since the scoring code calls it. So I would look for something that calls cycleGame(). Also, it sounds like you have a special trigger.cs since the usual trigger.cs contains template code for a DefaultTrigger that doesn't really do anything. Are you using some resource for triggering a mission load when a player walks onto a trigger?
#6
01/02/2007 (4:30 pm)
Yes, i am. however. thats the issue. i dont think that particular resource actually impacts the demo swapping feature. I have done a search for it. im using a resource for mission swapping. but even with those changes im still getting the demo to automatically switch after X amount of time. now im pretty sure its not in the trigger.cs But since AFx is different people as saying 1. they dont know where that code is, and 2. people have commented thatsome of the items have been linked differently.
#7
01/02/2007 (5:03 pm)
There's no code or scripting in AFX that directly does anything unusual with mission loading or swapping or anything like that, so there's nothing I can think of to point you at. Of course, we could be seeing some kind of odd code interaction or unintentional side-effect, but at this point I can't think of anything in AFX that might cause this.
#8
01/02/2007 (5:15 pm)
Yah i agree. still i would like to find where that demo code is that causes them to swap. You doknow what im talking about right. when you leave it alone it changes to the next demo mission after a few minutes. this code seems to be independant from anything in trigger.cs i looked through game.cs but i didnt see anything that looked like a timer or mentioned it being a demo feature. plus it changes the missions without a loading screen.
#9
01/02/2007 (5:23 pm)
Yeah, I think I understand. How exact is the timer wait, and how long? The only other theory I could come up with is that maybe an AI character runs across the trigger after a period of time, causing a mission reload. The obvious thing would be the $Game::Duration, but that appears to be ruled out. Have you tried setting it back to the 20*60 (20 minutes I think) or something longer?
#10
01/03/2007 (6:20 am)
Yah i agree. still i would like to find where that demo code is that causes them to swap. You doknow what im talking about right. when you leave it alone it changes to the next demo mission after a few minutes. this code seems to be independant from anything in trigger.cs i looked through game.cs but i didnt see anything that looked like a timer or mentioned it being a demo feature. plus it changes the missions without a loading screen.
#11
got the zoning to work, with a trigger, thanks for your support, Jeff. Imight take a break and makea new spell for you guys :)
01/03/2007 (7:57 am)
Http://www.garagegames.com/mg/forums/result.thread.php?qt=54060got the zoning to work, with a trigger, thanks for your support, Jeff. Imight take a break and makea new spell for you guys :)
Torque 3D Owner Billy L
$Game::Duration = 20 * 60;