Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 3 Vote(s) - 4.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My problems
naseem142 Offline
Member

Posts: 153
Threads: 19
Joined: Oct 2012
Reputation: 0
#41
RE: My problems

EDIT:

Something wrong happened , not with the function but with my script.
I wanted the player to get a Key_item when using a knife on the pig entity , but nothing happened.




void OnStart()

{
AddUseItemCallback("", "pig_knife", "piggy", "UsedKnifeOnDoor", true);
}


void UsedKnifeOnPig(string &in asItem, string &in asEntity)

{

GiveItem("Key_study", "Puzzle", "Key_study", "stone_hammer_chipper.tga", 0); /// i know that stone_hammer_chipper.tga is the image , i'll just change it later

PlaySoundAtEntity("", "attack_claw_hit.snt", "piggy", 0, false);

SetSwingDoorLocked("Locked_door0", false, true);

RemoveItem("pig_knife");

}

ANOTHER EDIT:

oh wait , lol i just found whats wrong when i posted. I should really check the script several times before posting. Blush

void OnStart()

{
AddUseItemCallback("", "pig_knife", "piggy", "UsedKnifeOnDoor", true);
}


void UsedKnifeOnPig(string &in asItem, string &in asEntity)

{

GiveItem("Key_study", "Puzzle", "Key_study", "stone_hammer_chipper.tga", 0); /// i know that stone_hammer_chipper.tga is the image , i'll just change it later

PlaySoundAtEntity("", "attack_claw_hit.snt", "piggy", 0, false);

SetSwingDoorLocked("Locked_door0", false, true);

RemoveItem("pig_knife");

}
(This post was last modified: 10-19-2012, 02:19 PM by naseem142.)
10-19-2012, 02:12 PM
Website Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#42
RE: My problems

(10-19-2012, 02:12 PM)naseem142 Wrote: EDIT:

Something wrong happened , not with the function but with my script.
I wanted the player to get a Key_item when using a knife on the pig entity , but nothing happened.




void OnStart()

{
AddUseItemCallback("", "pig_knife", "piggy", "UsedKnifeOnDoor", true);
}


void UsedKnifeOnDoor(string &in asItem, string &in asEntity)

{

GiveItem("Key_study", "Puzzle", "Key_study", "stone_hammer_chipper.tga", 0); /// i know that stone_hammer_chipper.tga is the image , i'll just change it later

PlaySoundAtEntity("", "attack_claw_hit.snt", "piggy", 0, false);

SetSwingDoorLocked("Locked_door0", false, true);

RemoveItem("pig_knife");

}
Edited out with bold. That's what seems to be wrong.

Oh lol. Post when I did, that's gotta be good.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
(This post was last modified: 10-19-2012, 02:20 PM by Robby.)
10-19-2012, 02:20 PM
Website Find
naseem142 Offline
Member

Posts: 153
Threads: 19
Joined: Oct 2012
Reputation: 0
#43
RE: My problems

I just got the weirdest unexplainable error...

[Image: Dq2eC.png]


I don't even have these functions in my script lines!
(This post was last modified: 10-19-2012, 03:00 PM by naseem142.)
10-19-2012, 03:00 PM
Website Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#44
RE: My problems

Try posting the entire script file. Use spoiler tags to make sure it ain't a massive wall of text the moment you open this thread.

This is odd, though. The 'ExecuteString' error also pops up at my place(harmless), but only if there's another error.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
10-19-2012, 03:05 PM
Website Find
naseem142 Offline
Member

Posts: 153
Threads: 19
Joined: Oct 2012
Reputation: 0
#45
RE: My problems

(10-19-2012, 03:05 PM)Nemet Robert Wrote: Try posting the entire script file. Use spoiler tags to make sure it ain't a massive wall of text the moment you open this thread.

This is odd, though. The 'ExecuteString' error also pops up at my place(harmless), but only if there's another error.
Spoiler below!
void OnStart()

{
AddEntityCollideCallback("Player", "Message_7", "Message7", true, 1);
AddEntityCollideCallback("Player", "Message_8", "Message8", true, 1);
AddUseItemCallback("", "orb_door1", "orbchamber1_1", "KeyOnDoor111", true);
AddUseItemCallback("", "orb_door2", "orbchamber1_2", "KeyOnDoor1111", true);
AddUseItemCallback("", "Key_3", "Prison_11", "KeyOnDoor11", true);
SetLocalVarInt("Var1", 0);
SetEntityPlayerInteractCallback("button1", "func1", true);
SetEntityPlayerInteractCallback("button2", "func2", true);
SetEntityPlayerInteractCallback("button3", "func3", true);
AddEntityCollideCallback("Player", "Message_4", "Message4", true, 1);
AddEntityCollideCallback("Player", "Message_6", "Message6", true, 1);
AddEntityCollideCallback("Player" , "brutetrap_scriptarea" , "MonsterFunc1" , true , 1);
AddEntityCollideCallback("Player" , "grunttrap_scriptarea" , "MonsterFunc2" , true , 1);
AddEntityCollideCallback("Player" , "body_trap_script_area" , "bodytrapfunc" , true , 1);
PreloadSound("brutetrapsound.ogg");
AddEntityCollideCallback("Player", "brutetrapsoundarea", "Sound", true, 1);
AddEntityCollideCallback("Player", "Message_5", "Message5", true, 1);
AddEntityCollideCallback("Player", "Message_3", "Message3", true, 1);
AddEntityCollideCallback("Player", "slamdoor", "func_slam", true, 1);
AddEntityCollideCallback("Player", "slamdoor2", "func_slam2", true, 1);
AddEntityCollideCallback("Player", "Play_Music_Script_Area", "PlayMusic1", true, 1);
AddEntityCollideCallback("Player", "KillTheLights", "LightsOut", true, 1);
AddUseItemCallback("", "crowbar_1", "mansiondoor_1", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1);
SetEntityCallbackFunc("des_orb", "OnPickup125");
AddUseItemCallback("", "des_orb", "Map_3_go", "UsedKeyOnDoor125", true);
}

void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer("", 0.2, "TimerSwitchShovel");
RemoveItem("crowbar_1");
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Map_3_go", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Map_3_go", 0, false);
RemoveItem("key_1");
}

void OnPickup125(string &in asEntity, string &in type)
{
SetEntityActive(servant_brute_125", true);
ShowEnemyPlayerPosition("servant_brute_125");
}

void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false);
SetEntityActive("crowbar_joint_1", true);
}


void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("mansiondoor_1", false, true);
AddPropImpulse("mansiondoor_1", 0, 0, -50, "World");
SetSwingDoorDisableAutoClose("mansiondoor_1", true);
SetSwingDoorClosed("mansiondoor_1", false, false);
SetMoveObjectState("mansiondoor_1", 1);
PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
}

/////////////////////////////////////////////////////////////////////////////////////////////////////

void bodytrapfunc(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("body_trap" , true);
GiveSanityDamage(5.0f, true);
}

void PlayMusic1(string &in asParent, string &in asChild, int alState)
{
PlayMusic("Ambience.ogg", true, 1, 1, 0, false);
}

void PlayMusic(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("sound", "brutetrapsound.ogg", "brutetrapsoundarea", 0.0, false);
}

void LightsOut(string &in asParent, string &in asChild, int alState)
{
SetLampLit("lamp_1", false, true);
AddTimer("", 0.1, "Out2");
}


void Out2(string &in asTimer)
{
SetLampLit("lamp_2", false, true);
AddTimer("", 0.1, "Out3");
}


void Out3(string &in asTimer)
{
SetLampLit("lamp_3", false, true);
AddTimer("", 0.1, "Out4");
}


void Out4(string &in asTimer)
{
SetLampLit("lamp_4", false, true);
AddTimer("", 0.1, "Out5");
}


void Out5(string &in asTimer)
{
SetLampLit("lamp_5", false, true);
AddTimer("", 0.1, "Out6");
}


void Out6(string &in asTimer)
{
SetLampLit("lamp_6", false, true);
}

void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("brutetrap" , true);
}

void MonsterFunc2(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("trapgrunt3" , true);
ShowEnemyPlayerPosition("trapgrunt3");
AddTimer("", 20.0f, "GruntDisable3");
}

void GruntDisable3(string &in asTimer)
{
SetEntityActive("trapgrunt3", false);
SetMessage("Messages", "Popup7", 0);
}

void KeyOnDoor11(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Prison_11", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Prison_11", 0.0f, true);
RemoveItem("key_3");
}

void KeyOnDoor111(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("orbchamber1_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "orbchamber1_1", 0.0f, true);
Removeitem("orb_door1");
}

void KeyOnDoor1111(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("orbchamber1_2", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "orbchamber1_2", 0.0f, true);
RemoveItem("orb_door2");
}

void Message1(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Popup4", 0);
}

void Message3(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Popup5", 0);
}

void Message5(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Popup5", 0);
}

void Message6(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Popup6", 0);
}

void Message8(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Popup8", 0);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("doorman", true, true);

SetSwingDoorLocked("doorman", true, true);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare", "Player", 0, false);

PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

GiveSanityDamage(5.0f, true);
}

void func_slam2(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("orbchamber1_2", true, true);

SetSwingDoorLocked("orbchamber1_2", true, true);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare", "Player", 0, false);

PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

GiveSanityDamage(5.0f, true);
}

void func1(string &in asEntity)
{
AddLocalVarInt("Var1", 1);
func5();
}

void func2(string &in asEntity)
{
AddLocalVarInt("Var1", 1);
func5();
}

void func3(string &in asEntity)
{
AddLocalVarInt("Var1", 1);
func5();
}

void func4(string &in asEntity)
{
AddLocalVarInt("Var1", 1);
func5();
}

void func5()
{
if(GetLocalVarInt("Var1") == 3)
{
/////Here what happens when all buttons are clicked vvvvvvvvvvvvv
SetSwingDoorLocked("doorman", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "doorman", 0.5f, false);
AddPlayerSanity(10);
}
}

10-19-2012, 03:08 PM
Website Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#46
RE: My problems

In the script, try checking the 259th line. That's where it says the "unexpected end of file" is occurring from (meaning something's missing). I looked, but can't find anything wrong.

And the ExecuteString errors aren't a problem. Maybe (they happened to appear, but only when there was a problem with the script file, otherwise, the ExecuteString error didn't even bother at all).

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
(This post was last modified: 10-19-2012, 03:14 PM by Robby.)
10-19-2012, 03:13 PM
Website Find
naseem142 Offline
Member

Posts: 153
Threads: 19
Joined: Oct 2012
Reputation: 0
#47
RE: My problems

(10-19-2012, 03:13 PM)Nemet Robert Wrote: In the script, try checking the 259th line. That's where it says the "unexpected end of file" is occurring from (meaning something's missing). I looked, but can't find anything wrong.

And the ExecuteString errors aren't a problem. Maybe (they happened to appear, but only when there was a problem with the script file, otherwise, the ExecuteString error didn't even bother at all).
It comes up when i enter the second map , and then the error comes and the game quits when i click ok.
10-19-2012, 03:25 PM
Website Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#48
RE: My problems

(10-19-2012, 03:25 PM)naseem142 Wrote:
(10-19-2012, 03:13 PM)Nemet Robert Wrote: In the script, try checking the 259th line. That's where it says the "unexpected end of file" is occurring from (meaning something's missing). I looked, but can't find anything wrong.

And the ExecuteString errors aren't a problem. Maybe (they happened to appear, but only when there was a problem with the script file, otherwise, the ExecuteString error didn't even bother at all).
It comes up when i enter the second map , and then the error comes and the game quits when i click ok.
That's normal for that. As I said, check line 259 in your script. Maybe there's something missing there.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
10-19-2012, 03:26 PM
Website Find
naseem142 Offline
Member

Posts: 153
Threads: 19
Joined: Oct 2012
Reputation: 0
#49
RE: My problems

(10-19-2012, 03:26 PM)Nemet Robert Wrote:
(10-19-2012, 03:25 PM)naseem142 Wrote:
(10-19-2012, 03:13 PM)Nemet Robert Wrote: In the script, try checking the 259th line. That's where it says the "unexpected end of file" is occurring from (meaning something's missing). I looked, but can't find anything wrong.

And the ExecuteString errors aren't a problem. Maybe (they happened to appear, but only when there was a problem with the script file, otherwise, the ExecuteString error didn't even bother at all).
It comes up when i enter the second map , and then the error comes and the game quits when i click ok.
That's normal for that. As I said, check line 259 in your script. Maybe there's something missing there.
I'm pretty sure there is nothing missing
10-19-2012, 03:38 PM
Website Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#50
RE: My problems

Da hell? Just checked your script, and there are 258 lines, there isn't a 259th line. Unless you left a space there.

This means a problem arose somewhere. Maybe a newly added function caused that. Try removing the newly added function, and see if the problem reappears. If yes, it means there's a big problem.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
(This post was last modified: 10-19-2012, 03:42 PM by Robby.)
10-19-2012, 03:40 PM
Website Find




Users browsing this thread: 1 Guest(s)