Changing to another map would be:
ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);
Immediatly loads another map.
asMapName - the file to load
asStartPos - the name of the StartPos on the next map
asStartSound - the sound that is played when the change starts
asEndSound - the sound that is played when the new map is loaded
You would have to play with variables to solve the other stuff
For 3:
void OnStart();
{
AddEntityCollideCallback("Entity_1", "Script_1", "Blah", true, 1);
AddEntityCollideCallback("Entity_2", "Script_2", "Blah_1", true, 1);
}
void Blah (string &in asParent, string &in asChild, int alState)
{
AddLocalVarInt("Gangnam", 1);
func_check();
}
void Blah_1 (string &in asParent, string &in asChild, int alState)
{
AddLocalVarInt("Gangnam", 1);
func_check();
}
void func_check();
{
if (GetLocalVarInt("Gangnam") == 2)
{
SetEntityConnectionStateChangeCallback("Levar_elevator", "Map");
}
}
void Map (string &in asEntity, int alState)
{
if (alState == 1)
{
ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);
}
}
(11-03-2012, 02:26 PM)beecake Wrote: [ -> ]Changing to another map would be:
ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);
Immediatly loads another map.
asMapName - the file to load
asStartPos - the name of the StartPos on the next map
asStartSound - the sound that is played when the change starts
asEndSound - the sound that is played when the new map is loaded
You would have to play with variables to solve the other stuff
It doesn't work, I've tried
SetEntityPlayerInteractCallback and
SetEntityCallbackFunc.
I don't know if it's possible to call a function by examining
(11-04-2012, 12:17 AM)The chaser Wrote: [ -> ]Does my script work?
No, it crashes.
I get the following error in the hpl.log:
------- SCRIPT OUTPUT BEGIN --------------------------
main (2, 1) : ERR : Unexpected token '{'
main (20, 1) : ERR : Unexpected token '{'
------- SCRIPT OUTPUT END ----------------------------
FATAL ERROR: Could not load script file 'TheManMachine/maps/14_MechanicalLaboratory.hps'!
main (2, 1) : ERR : Unexpected token '{'
main (20, 1) : ERR : Unexpected token '{'
Silly me
void OnStart()
{
AddEntityCollideCallback("Entity_1", "Script_1", "Blah", true, 1);
AddEntityCollideCallback("Entity_2", "Script_2", "Blah_1", true, 1);
}
void Blah (string &in asParent, string &in asChild, int alState)
{
AddLocalVarInt("Gangnam", 1);
func_check();
}
void Blah_1 (string &in asParent, string &in asChild, int alState)
{
AddLocalVarInt("Gangnam", 1);
func_check();
}
void func_check();
{
if (GetLocalVarInt("Gangnam") == 2)
{
SetEntityConnectionStateChangeCallback("Levar_elevator", "Map");
}
}
void Map (string &in asEntity, int alState)
{
if (alState == 1)
{
ChangeMap
(string
& asMapName
, string
& asStartPos
, string
& asStartSound
, string
& asEndSound
);
}
}
This is the correct script
I still get:
------- SCRIPT OUTPUT BEGIN --------------------------
main (20, 1) : ERR : Unexpected token '{'
------- SCRIPT OUTPUT END ----------------------------
FATAL ERROR: Could not load script file 'TheManMachine/maps/14_MechanicalLaboratory.hps'!
main (20, 1) : ERR : Unexpected token '{'