Zones (missions) Help
by DarkProfit · in Torque Game Engine · 06/10/2005 (2:01 pm) · 21 replies
I have been trying to create a zone and a trigger to load a new zone (ie: missions)
I added a trigger event and area all that works fine right up to the point
where it brings up the "loading mission"dialog. Just sits there and hangs
im not sure what i am doing wrong (have even tried calling the function from
the console and same thing just hangs telling me waiting for server).
I am a little confused I am already connected to the server and dont want
to connect and reconnect i just want to load the new mission.
I have even tried the resource for teleporting etc. but cant get it to work.
I have even tried just going to console and typing
loadMission("~/data/missions/racing.mis", true);
and it does the same thing
Anyideas or code would be greatly appericated :)
Also another quick question.
is there any reason why i could execute "functions" etc. that you would normaly
put in a cs file inside the mis file?
I added a trigger event and area all that works fine right up to the point
where it brings up the "loading mission"dialog. Just sits there and hangs
im not sure what i am doing wrong (have even tried calling the function from
the console and same thing just hangs telling me waiting for server).
I am a little confused I am already connected to the server and dont want
to connect and reconnect i just want to load the new mission.
I have even tried the resource for teleporting etc. but cant get it to work.
I have even tried just going to console and typing
loadMission("~/data/missions/racing.mis", true);
and it does the same thing
Anyideas or code would be greatly appericated :)
Also another quick question.
is there any reason why i could execute "functions" etc. that you would normaly
put in a cs file inside the mis file?
About the author
#2
at this point i am totally clueless it does detect the trigger and attempts to
load up the new mission. but just opens the "loading mission" box and never
does anything from that point just stays there.
06/10/2005 (2:42 pm)
Its on the server/scripts/triggers.csdatablock TriggerData(name_of_teleport){
tickPeriodMS = 100;
};
function name_of_teleport::onEnterTrigger(%this,%trigger,%obj){
Parent::onEnterTrigger(%this,%trigger,%obj);
LaunchMission( %this.scene_param, %this.spanwsphere_param );
}
function LaunchMission( %mission, %spawn, %timeout ){
if ( !$Game::LaunchingMission ) {
$Game::NextMission = %mission;
$Game::NextSpawn = %spawn;
$Game::LaunchingMission = true;
schedule( %timeout, 0, "onLaunchMission" );
}
}
function onLaunchMission(){
echo("Loading nLaunchMission");
$Game::LaunchingMission = true;
loadMission("~/data/missions/racing.mis", true);
}at this point i am totally clueless it does detect the trigger and attempts to
load up the new mission. but just opens the "loading mission" box and never
does anything from that point just stays there.
#3
somewhere in your Load Code.
06/10/2005 (2:47 pm)
If the console log doesn't help, I recommend turning ontrace(true);
somewhere in your Load Code.
#4
06/10/2005 (2:49 pm)
Yeah it doesnt say anything just sits there.
#5
06/10/2005 (2:54 pm)
With trace()? When do you start tracing?
#6
make sure to start trace(true) (or trace(1) before you load the mission, find out where it stalls
EDIT: all the trace info is output to the console
06/10/2005 (2:56 pm)
(probalby what Mark was about to suggest)make sure to start trace(true) (or trace(1) before you load the mission, find out where it stalls
EDIT: all the trace info is output to the console
#7
think i just found the problem but dont know why
"Could not find mission ~/data/missions/racing.mis"
but it is infact there?
**edit**
yeah just did that and found the error above but the mission is in that location.
06/10/2005 (2:57 pm)
At begining of filethink i just found the problem but dont know why
"Could not find mission ~/data/missions/racing.mis"
but it is infact there?
**edit**
yeah just did that and found the error above but the mission is in that location.
#8
Trying to access like this "~/data/missions/racing.mis"
and the function is called from
D:\Test\Main\Server\scripts\triggers.cs
any ideas?
06/10/2005 (3:08 pm)
Ok now im confused as all hell, says it can't find the mission.Trying to access like this "~/data/missions/racing.mis"
and the function is called from
D:\Test\Main\Server\scripts\triggers.cs
any ideas?
#9
load mission with trigger just hangs anyone help me out that would be great :)
just using the "tuturial.base" example with 2 mission files
load 1st mission then have a trigger inside the mission "anywhere" that
loads new mission file. just hangs with the loading mission dialog
06/13/2005 (6:16 am)
Still havent been able to load a new mission just using basicload mission with trigger just hangs anyone help me out that would be great :)
just using the "tuturial.base" example with 2 mission files
load 1st mission then have a trigger inside the mission "anywhere" that
loads new mission file. just hangs with the loading mission dialog
#10
You need to clear texturehandles/purge or call onDisconnect before loading a new mission, though.. but I'm not sure that's what's causing you grief. Might be worth a shot though, as I said.. it worked great last time I tried it on stock TGE. (to show a friend how to do it)
06/13/2005 (6:18 am)
Worked great last time I tried it with stock TGE.You need to clear texturehandles/purge or call onDisconnect before loading a new mission, though.. but I'm not sure that's what's causing you grief. Might be worth a shot though, as I said.. it worked great last time I tried it on stock TGE. (to show a friend how to do it)
#11
like alot of over head on the server? I will try to do that and see what happens but I think i have already
tried to disconnect then reconnect... Is there away around this at all? It would kind of suck to have
a big universe and having people diconnecting and reconnecting all the time to load a new zone kind
of goofy and what happens to the other people that are in that zone? does the server then load a new
zone on everyone?
Sorry little confused.
06/13/2005 (6:24 am)
Yeah i am using the stock tge to try it as well, why would i have to disconnect and reconnect? that seemslike alot of over head on the server? I will try to do that and see what happens but I think i have already
tried to disconnect then reconnect... Is there away around this at all? It would kind of suck to have
a big universe and having people diconnecting and reconnecting all the time to load a new zone kind
of goofy and what happens to the other people that are in that zone? does the server then load a new
zone on everyone?
Sorry little confused.
#12
What is your intention with this code? To make a client switch server, or make the server switch mission?
If the latter, you should take a look at how they did it in Tribes II. Great source of scripting information, trust me.
06/13/2005 (6:52 am)
I assumed you were doing this on a listen-server, being the only player connected.What is your intention with this code? To make a client switch server, or make the server switch mission?
If the latter, you should take a look at how they did it in Tribes II. Great source of scripting information, trust me.
#13
1 Server (down range will be mulitple servers of course) but for example will scale it down.
Lets say 10 people
What i am trying to do is basicly have say a bunch of lands ie: zones like, city of heros, everquest etc.
and when they hit the zone they goto a different land etc. you could potentional have
10 differnet zone running at the same time with 1 person in each zone or
5 zones going with 2 people in each zone etc. ie: i could be in a dungen and you could be exploring
some other land somewhere...
didnt know the source was avalable for tribes II do you have a link? sorry never played the game before.
06/13/2005 (6:58 am)
Basicly I am looking to do the following:1 Server (down range will be mulitple servers of course) but for example will scale it down.
Lets say 10 people
What i am trying to do is basicly have say a bunch of lands ie: zones like, city of heros, everquest etc.
and when they hit the zone they goto a different land etc. you could potentional have
10 differnet zone running at the same time with 1 person in each zone or
5 zones going with 2 people in each zone etc. ie: i could be in a dungen and you could be exploring
some other land somewhere...
didnt know the source was avalable for tribes II do you have a link? sorry never played the game before.
#14
What you're trying to do is change the current server to a new zone, of which ALL players currently in the zone will be disconnected, and the one player who triggered the event will simply not get anywhere.
What you need to do is create a trigger of the same type that you've tried already, and then make the client disconnect upon touching the trigger.. and then connect to another IP/Port altogether.
What you show in your example above is somewhat close to what Tribes/Counter-Strike does when one game is over.
Maybe I misunderstood your intentions or my interpretation of the above code is wrong, but that's the feeling I got reading it over pretty fast.
06/13/2005 (9:59 am)
Then why are you trying to switch the zone on the fly, for the same dedicated server instance?What you're trying to do is change the current server to a new zone, of which ALL players currently in the zone will be disconnected, and the one player who triggered the event will simply not get anywhere.
What you need to do is create a trigger of the same type that you've tried already, and then make the client disconnect upon touching the trigger.. and then connect to another IP/Port altogether.
What you show in your example above is somewhat close to what Tribes/Counter-Strike does when one game is over.
Maybe I misunderstood your intentions or my interpretation of the above code is wrong, but that's the feeling I got reading it over pretty fast.
#15
guess i am going to have to write a custom server to handle this seems like the default
network logic in tge is designed for tribes/counterstrike type logic where everything is mission
based ie: mission complete everyone gets the boot and the server starts a new mission.
where this would have a persistant connection and the client would probally handle all
the zones etc. and the server would just send information on what to load etc.
06/13/2005 (10:03 am)
In the tribes/counter strike logic you would be correct but in a MMORPG that is not the caseguess i am going to have to write a custom server to handle this seems like the default
network logic in tge is designed for tribes/counterstrike type logic where everything is mission
based ie: mission complete everyone gets the boot and the server starts a new mission.
where this would have a persistant connection and the client would probally handle all
the zones etc. and the server would just send information on what to load etc.
#16
06/13/2005 (10:41 am)
You're missing the point with the CS/Tribes comparasion. I just pointed out that what you tried doing in the code snippet above is not the same as what you're asking for.
#17
06/13/2005 (10:43 am)
Aye i understand :)
#18
Torque out of the box doesn't handle multiple server missions instances in a single executable.
06/14/2005 (12:10 pm)
As Stefan said, to do the "everquest zoning" type of scenario, you will want to have multiple dedicated server apps on your machine(s), each running on a different port, and each running a specific zone (as a mission). Then, when a player "zones", they disconnect from their current zone, and re-connect to the server that has the "new" zone.Torque out of the box doesn't handle multiple server missions instances in a single executable.
#19
I don't know of any online game that runs mutiple zones on a single server instance.
06/15/2005 (11:13 am)
Multiple servers is exactly the way that EQ2, WoW, etc, handle zoning. When you move from one zone to another you disconnect from one zone server and connect to another.I don't know of any online game that runs mutiple zones on a single server instance.
#20
For testing a couple maps just running seperate instances of Torque as a dedicated server with the mission loaded to a different port would work fine... though if your attempting to start the framework of an MMO you will want a couple different servers running (as mentioned login, world, and zone server...) where its pretty self explanitory, login server handles the logins, world is somewhat like the middleman/manager, launches the correct zone servers and directs connections properly, while the zone server is the dedicated instance of the zone ("mission") file for the world server to direct the player to upon "zoning". At least this is how EQ Emu worked it back when.
06/15/2005 (11:20 am)
Very true... most of them have a dedicated version that acts as a zone server that can be run as a seperate instance (as well as a world server and a login server), so you'd run each of your areas as a seperate dedicated instance. With a bit of work you can have dynamic zone loading, where the zoned will load a new zoneServer with the correct mission file within it, but that would definately take a bit of work :) For testing a couple maps just running seperate instances of Torque as a dedicated server with the mission loaded to a different port would work fine... though if your attempting to start the framework of an MMO you will want a couple different servers running (as mentioned login, world, and zone server...) where its pretty self explanitory, login server handles the logins, world is somewhat like the middleman/manager, launches the correct zone servers and directs connections properly, while the zone server is the dedicated instance of the zone ("mission") file for the world server to direct the player to upon "zoning". At least this is how EQ Emu worked it back when.
Torque Owner Mark Storer