Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Map Transitions
Author Message
Chilton Offline
Member

Posts: 138
Joined: Sep 2010
Reputation: 0
Post: #1
Map Transitions
Before i begin, this may have already been stated somewere, but the search tool yielded far far far too many results when i searched for it, so i apologise if this has been stated.

My question is, how to you make an Area Script or somesuch thing to move you to another map? Or more accurately, what should the script look like?
I tried using an entity callback, but either i did something wrong, or the engine doesnt like callbacks leading to functions...

Any aid is much appreciated
09-27-2010 04:32 AM
Find all posts by this user Quote this message in a reply
Equil Offline
Member

Posts: 94
Joined: Sep 2010
Reputation: 0
Post: #2
RE: Map Transitions
Have you tried using the function:
ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);
09-27-2010 05:49 AM
Find all posts by this user Quote this message in a reply
Chilton Offline
Member

Posts: 138
Joined: Sep 2010
Reputation: 0
Post: #3
RE: Map Transitions
(09-27-2010 05:49 AM)Equil Wrote:  Have you tried using the function:
ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);

Yes, i have the function, but how to i make that function relevant to a particular area?

EDIT: Ie, how do i make it apply to a door, or Area Script?
09-27-2010 05:59 AM
Find all posts by this user Quote this message in a reply
Equil Offline
Member

Posts: 94
Joined: Sep 2010
Reputation: 0
Post: #4
RE: Map Transitions
In your OnStart() put
AddEntityCollideCallback("Player", "<NameOfArea>", "<FunctionToCall>", true, 1);

So it should look something like:
void OnStart()
{
AddEntityCollideCallback("Player", "<NameOfArea>", "<FunctionToCall>", true, 1);
}

void FunctionToCall(string &in asParent, string &in asChild, int alState)
{
ChangeMap("<MapToChangeTo>", string& asStartPos, string& asStartSound, string& asEndSound);
}

Hope this helps.
09-27-2010 06:07 AM
Find all posts by this user Quote this message in a reply
Chilton Offline
Member

Posts: 138
Joined: Sep 2010
Reputation: 0
Post: #5
RE: Map Transitions
(09-27-2010 06:07 AM)Equil Wrote:  In your OnStart() put
AddEntityCollideCallback("Player", "<NameOfArea>", "<FunctionToCall>", true, 1);

So it should look something like:
void OnStart()
{
AddEntityCollideCallback("Player", "<NameOfArea>", "<FunctionToCall>", true, 1);
}

void FunctionToCall[u](string &in asParent, string &in asChild, int alState)[/u]
{
ChangeMap("<MapToChangeTo>", string& asStartPos, string& asStartSound, string& asEndSound);
}

Hope this helps.

Worked a charm - Thankyou kindly - The underline is what i missed
09-27-2010 06:13 AM
Find all posts by this user Quote this message in a reply
Equil Offline
Member

Posts: 94
Joined: Sep 2010
Reputation: 0
Post: #6
RE: Map Transitions
No problem, glad to help. Smile
09-27-2010 06:19 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)