Hatred
Junior Member
Posts: 10
Threads: 3
Joined: Feb 2012
Reputation:
1
|
Help with scripting!
Hi everyone! I'm new here as you may have noticed, but enough chitchat.
I'm having a problem. I have started making my own custom story a couple days backwards and I can't test my map because when I try to start the map, Fatal Error jumps up and says (27,19) unexpected data type.
I have done some scripting and yes, I have watched some tutorials from youtube and so on, but I haven't figured out how I can test my map.
I've spent so many hours trying to solve this error and...NOTHING!
I will post my script here if anyone is interested in helping me!
|
|
02-12-2012, 11:25 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: Help with scripting!
We need the script
|
|
02-12-2012, 11:30 AM |
|
Hatred
Junior Member
Posts: 10
Threads: 3
Joined: Feb 2012
Reputation:
1
|
RE: Help with scripting!
Here it is!
////////////////////////////
// Run first time starting map
void OnStart()
{
PlayMusic("02_amb_safe", true, 0.7f, 1, 0, true);
SetEnemyIsHallucination("Morso1", 2);
SetEntityCallbackFunc("guiding_rod01_1", "ActivateMonster", true);
AddUseItemCallback("", "key_study_1", "mansion_4", "UsedKeyOnDoor", true);
AddUseItemCallback("", "hollow_needle_1", "mansion_2", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "Area2", "CollideArea2", true, 1);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_4", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_4", 0, false);
RemoveUseItem("key_study_1");
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_2", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_2", 0, false);
RemoveUseItem("hollow_needle_1");
}
void CollideArea2("Player", "Area2", 1)
{
SetSwingDoorClosed("mansion_2", true, true);
}
void ActivateMonster(string &in Item)
{
SetEntityActive("Morso2", true);
AddEnemyPatrolNode("Morso2", "PathNodeArea_1", 0, "Idle");
AddEnemyPatrolNode("Morso2", "PathNodeArea_2", 0, "Idle");
AddEnemyPatrolNode("Morso2", "PathNodeArea_3", 0, "Idle");
AddEnemyPatrolNode("Morso2", "PathNodeArea_4", 0, "Idle");
AddEnemyPatrolNode("Morso2", "PathNodeArea_5", 0, "Idle");
AddEnemyPatrolNode("Morso2", "PathNodeArea_6", 0, "Idle");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
|
|
02-12-2012, 11:32 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: Help with scripting!
Don't change syntax's, use this:
////////////////////////////
// Run first time starting map
void OnStart()
{
PlayMusic("02_amb_safe", true, 0.7f, 1, 0, true);
SetEnemyIsHallucination("Morso1", 2);
SetEntityCallbackFunc("guiding_rod01_1", "ActivateMonster", true);
AddUseItemCallback("", "key_study_1", "mansion_4", "UsedKeyOnDoor", true);
AddUseItemCallback("", "hollow_needle_1", "mansion_2", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "Area2", "CollideArea2", true, 1);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_4", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_4", 0, false);
RemoveUseItem("key_study_1");
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_2", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_2", 0, false);
RemoveUseItem("hollow_needle_1");
}
void CollideArea2(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_2", true, true);
}
void ActivateMonster(string &in Item)
{
SetEntityActive("Morso2", true);
AddEnemyPatrolNode("Morso2", "PathNodeArea_1", 0, "Idle");
AddEnemyPatrolNode("Morso2", "PathNodeArea_2", 0, "Idle");
AddEnemyPatrolNode("Morso2", "PathNodeArea_3", 0, "Idle");
AddEnemyPatrolNode("Morso2", "PathNodeArea_4", 0, "Idle");
AddEnemyPatrolNode("Morso2", "PathNodeArea_5", 0, "Idle");
AddEnemyPatrolNode("Morso2", "PathNodeArea_6", 0, "Idle");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
|
|
02-12-2012, 11:53 AM |
|
Hatred
Junior Member
Posts: 10
Threads: 3
Joined: Feb 2012
Reputation:
1
|
RE: Help with scripting!
Hmm...now another fatal error pops up.
Fatal Error: Could not load script file 'custom_stories/MyCustom/maps/00_mycustom.hps'!
main (20,1) : ERR : A function with the same name and parameters already exist
main (6,1) : ERR : No matching signatures to 'SetEnemyIsHallucination(string@&, const uint)'
main (7,1) : ERR : No matching signatures to 'SetEntityCallBackFunc(string@&, string@&, const bool)'
main (17,1) : ERR : No matching signatures to 'RemoveUseItem(string@& )'
main (24,1) : ERR : No matching signatures to 'RemoveUseItem(string@& )'
(This post was last modified: 02-12-2012, 12:09 PM by Hatred.)
|
|
02-12-2012, 12:08 PM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
|
02-12-2012, 12:26 PM |
|
Linus Ågren
Senior Member
Posts: 309
Threads: 58
Joined: Jan 2011
Reputation:
5
|
|
02-12-2012, 12:33 PM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: Help with scripting!
I would love to know where you got that UsedKeyOnDoor function.
|
|
02-12-2012, 06:07 PM |
|
Hatred
Junior Member
Posts: 10
Threads: 3
Joined: Feb 2012
Reputation:
1
|
RE: Help with scripting!
Allright!
@flamez3 I read the wiki you linked and @junkfood2121 I watched your links too.
I started making a new map and have scripted about 4 hours now and it works like a charm.
Thanks guys!
If not the easy way, then the hard way.
By the way, I love to make my own custom, hope I can release it here someday when it's finished.
@YourComputer, that's a good question. I did watch many tutorials and maybe I somehow just came up with it, I don't know.
|
|
02-12-2012, 08:56 PM |
|
|