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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Please help me :(
pdkgaming Offline
Junior Member

Posts: 16
Threads: 3
Joined: Jun 2012
Reputation: 0
#21
RE: Please help me :(

(06-13-2012, 09:46 PM)GrAVit Wrote:
(06-13-2012, 09:33 PM)pdkgaming Wrote:
(06-13-2012, 09:31 PM)GrAVit Wrote: I'm not sure if timers work well with what happens when Player looks at entity.
owh.. but how can I make my player to look at 3 entities with 1 second between them? (or more seconds..)
Yes.
uhh.... what? I asked how I could do it differentlyy :p

Map tester
CS creator (beginner)
Youtube:
http://www.youtube.com/pdkgaming
06-13-2012, 09:47 PM
Website Find
GrAVit Offline
Senior Member

Posts: 580
Threads: 15
Joined: Oct 2011
Reputation: 22
#22
RE: Please help me :(

(06-13-2012, 09:47 PM)pdkgaming Wrote:
(06-13-2012, 09:46 PM)GrAVit Wrote:
(06-13-2012, 09:33 PM)pdkgaming Wrote:
(06-13-2012, 09:31 PM)GrAVit Wrote: I'm not sure if timers work well with what happens when Player looks at entity.
owh.. but how can I make my player to look at 3 entities with 1 second between them? (or more seconds..)
Yes.
uhh.... what? I asked how I could do it differentlyy :p

Sorry, misread. You make the function that activates after the player stares at the entity something different than a timer. Then you add "AddTimer" in the function, and in the timer that will be added, you put the code which was in the initial timer. Please note that I do not guarantee this will work, but it is the best I can give you.

(This post was last modified: 06-13-2012, 09:52 PM by GrAVit.)
06-13-2012, 09:51 PM
Find
pdkgaming Offline
Junior Member

Posts: 16
Threads: 3
Joined: Jun 2012
Reputation: 0
#23
RE: Please help me :(

(06-13-2012, 09:51 PM)GrAVit Wrote:
(06-13-2012, 09:47 PM)pdkgaming Wrote:
(06-13-2012, 09:46 PM)GrAVit Wrote:
(06-13-2012, 09:33 PM)pdkgaming Wrote:
(06-13-2012, 09:31 PM)GrAVit Wrote: I'm not sure if timers work well with what happens when Player looks at entity.
owh.. but how can I make my player to look at 3 entities with 1 second between them? (or more seconds..)
Yes.
uhh.... what? I asked how I could do it differentlyy :p

Sorry, misread. You make the function that activates after the player stares at the entity something different than a timer. Then you add "AddTimer" in the function, and in the timer that will be added, you put the code which was in the initial timer. Please note that I do not guarantee this will work, but it is the best I can give you.
okay.. trying to figure the stuff out.. Takes a lot of complicated thinking haha, but I'll let you know how it works after I'm done Big Grin

okay... I think I just messed it up... Still a beginner haha :p So that's alright..

Im giving you my whole script once again.. im getting tons of errors:

main (43, 1) : INFO : Compiling void Function_corpse(string&in)
main (45, 2) : ERR : No matching signatures to "SetEntityPlayerLookAtCallback(string@&, string @&, const uint)"
main (45, 2) : INFO : Candidates are:
main (45, 2) : INFO : void SetEntityPlayerLookAtCallback(string&in, string&in, bool)


void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "playsound", true, 1);
AddUseItemCallback("StudyKey", "studykey_1", "mansion_2", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "ScriptArea_2", "EnemyAppear", true, 1);
AddEntityCollideCallback("servant_grunt_2", "ScriptArea_3", "EnemyDisable", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "Look_at_corpse", true, 1);
}

void playsound(string &in asParent, string &in asChild, int alState)
{
PlayMusic("break_wood1.ogg", false, 1, 0, 1.0, false);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_2", false, true);
PlaySoundAtEntity("unlock_door.snt", "unlock_door", "mansion_2", 0.0f, false);
RemoveItem("studykey_1");
}

void EnemyAppear(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", true);
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_1", 1, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_2", 2, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_2", 2, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_3", 2, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_4", 2, "");
}

void EnemyDisable(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("servant_grunt_1", false);
}

void Look_at_corpse(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("corpse_male_torso_1", 100, 100, "Function_corpse");
}

void Function_corpse(string &in asEntity)
{
SetEntityPlayerLookAtCallback("Look", "Timer_Next_1", 1);
}

void Timer_Next_1(string &in asTimer)
{
AddTimer("LookNext", 1, "Function_chest");
}

void Function_chest(string &in asEntity)
{
StartPlayerLookAt("chest_of_drawers_nice_broken_1", 100, 100, "Timer_Next_2");
}

void Timer_Next_2(string &in asTimer)
{
AddTimer("LookNext2", 1, "Function_painting");
}

void Function_painting(string &in asEntity)
{
StartPlayerLookAt("painting03_1", 100, 100, "Timer_Next_3");
}

void OnLeave()
{

}

And again.. sorry for leaving such long posts... I feel like a jerk whaha..
Anyways... HELP! XD

Map tester
CS creator (beginner)
Youtube:
http://www.youtube.com/pdkgaming
(This post was last modified: 06-13-2012, 10:23 PM by pdkgaming.)
06-13-2012, 09:59 PM
Website Find
GrAVit Offline
Senior Member

Posts: 580
Threads: 15
Joined: Oct 2011
Reputation: 22
#24
RE: Please help me :(

(06-13-2012, 09:59 PM)pdkgaming Wrote:
(06-13-2012, 09:51 PM)GrAVit Wrote:
(06-13-2012, 09:47 PM)pdkgaming Wrote:
(06-13-2012, 09:46 PM)GrAVit Wrote:
(06-13-2012, 09:33 PM)pdkgaming Wrote: owh.. but how can I make my player to look at 3 entities with 1 second between them? (or more seconds..)
Yes.
uhh.... what? I asked how I could do it differentlyy :p

Sorry, misread. You make the function that activates after the player stares at the entity something different than a timer. Then you add "AddTimer" in the function, and in the timer that will be added, you put the code which was in the initial timer. Please note that I do not guarantee this will work, but it is the best I can give you.
okay.. trying to figure the stuff out.. Takes a lot of complicated thinking haha, but I'll let you know how it works after I'm done Big Grin

okay... I think I just messed it up... Still a beginner haha :p So that's alright..

Im giving you my whole script once again.. im getting tons of errors:

main (43, 1) : INFO : Compiling void Function_corpse(string&in)
main (45, 2) : ERR : No matching signatures to "SetEntityPlayerLookAtCallback(string@&, string @&, const uint)"
main (45, 2) : INFO : Candidates are:
main (45, 2) : INFO : void SetEntityPlayerLookAtCallback(string&in, string&in, bool)


void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "playsound", true, 1);
AddUseItemCallback("StudyKey", "studykey_1", "mansion_2", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "ScriptArea_2", "EnemyAppear", true, 1);
AddEntityCollideCallback("servant_grunt_2", "ScriptArea_3", "EnemyDisable", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "Look_at_corpse", true, 1);
}

void playsound(string &in asParent, string &in asChild, int alState)
{
PlayMusic("break_wood1.ogg", false, 1, 0, 1.0, false);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_2", false, true);
PlaySoundAtEntity("unlock_door.snt", "unlock_door", "mansion_2", 0.0f, false);
RemoveItem("studykey_1");
}

void EnemyAppear(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", true);
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_1", 1, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_2", 2, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_2", 2, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_3", 2, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_4", 2, "");
}

void EnemyDisable(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("servant_grunt_1", false);
}

void Look_at_corpse(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("corpse_male_torso_1", 100, 100, "Function_corpse");
}

void Function_corpse(string &in asEntity)
{
SetEntityPlayerLookAtCallback("Look", "Timer_Next_1", 1);
}

void Timer_Next_1(string &in asTimer)
{
AddTimer("LookNext", 1, "Function_chest");
}

void Function_chest(string &in asEntity)
{
StartPlayerLookAt("chest_of_drawers_nice_broken_1", 100, 100, "Timer_Next_2");
}

void Timer_Next_2(string &in asTimer)
{
AddTimer("LookNext2", 1, "Function_painting");
}

void Function_painting(string &in asEntity)
{
StartPlayerLookAt("painting03_1", 100, 100, "Timer_Next_3");
}

void OnLeave()
{

}

And again.. sorry for leaving such long posts... I feel like a jerk whaha..
Anyways... HELP! XD

void Function_corpse(string &in asEntity)
{
SetEntityPlayerLookAtCallback("Look", "Timer_Next_1", 1);
}

Should be
void Function_corpse(string &in asEntity)
{
AddTimer("Look", 1, "Timer_Next_1");
}

etc. and do it for all of them

(This post was last modified: 06-13-2012, 10:48 PM by GrAVit.)
06-13-2012, 10:45 PM
Find
pdkgaming Offline
Junior Member

Posts: 16
Threads: 3
Joined: Jun 2012
Reputation: 0
#25
RE: Please help me :(

okay.. worked on it a bit and changed the script.. It is easier to read now but the same problem is still there... here is the part of the script where it is supposed to look at 3 different entities.. though it still watches at "corpse_male_torso_1" I don't see a problem... So here I am.. asking for help again >.<


void Look_at_corpse(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("corpse_male_torso_1", 100, 100, "Function_corpse");
}


void Function_corpse(string &in asTimer)
{
AddTimer("LookNext", 1, "Timer_Next_2");
}


void Timer_Next_2(string &in asEntity)
{
StartPlayerLookAt("chest_of_drawers_nice_broken_1", 100, 100, "Function_painting");
}


void Function_painting(string &in asTimer)
{
AddTimer("LookNext3", 1, "Timer_Next_3");
}


void Timer_Next_3(string &in asEntity)
{
StartPlayerLookAt("painting03_1", 100, 100, "Function_Sanity");
}


void Function_Sanity(string &in asEntity, string &in asTimer)
{
SetPlayerSanity(0);
FadeOut(5);
AddTimer("newmap", 5, "Change_Map");
}


void Change_Map(string &in asEntity)
{
ChangeMap("new2.map", "Player_startPos_1", "", "");
}

Owh btw... dont mind the change_map function.. that was just for myself so I knew what to do next.. I dont have another map yet, I was just giving myself a sketch while I was at school scripting.. So couldn't test it yet :p

Map tester
CS creator (beginner)
Youtube:
http://www.youtube.com/pdkgaming
06-14-2012, 07:01 PM
Website Find
GrAVit Offline
Senior Member

Posts: 580
Threads: 15
Joined: Oct 2011
Reputation: 22
#26
RE: Please help me :(

(06-14-2012, 07:01 PM)pdkgaming Wrote: okay.. worked on it a bit and changed the script.. It is easier to read now but the same problem is still there... here is the part of the script where it is supposed to look at 3 different entities.. though it still watches at "corpse_male_torso_1" I don't see a problem... So here I am.. asking for help again >.<


void Look_at_corpse(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("corpse_male_torso_1", 100, 100, "Function_corpse");
}

void Function_corpse(string &in asTimer)
{
AddTimer("LookNext", 1, "Timer_Next_2");
}

void Timer_Next_2(string &in asEntity)
{
StartPlayerLookAt("chest_of_drawers_nice_broken_1", 100, 100, "Function_painting");
}

void Function_painting(string &in asTimer)
{
AddTimer("LookNext3", 1, "Timer_Next_3");
}

void Timer_Next_3(string &in asEntity)
{
StartPlayerLookAt("painting03_1", 100, 100, "Function_Sanity");
}

void Function_Sanity(string &in asEntity, string &in asTimer)
{
SetPlayerSanity(0);
FadeOut(5);
AddTimer("newmap", 5, "Change_Map");
}

void Change_Map(string &in asEntity)
{
ChangeMap("new2.map", "Player_startPos_1", "", "");
}

Owh btw... dont mind the change_map function.. that was just for myself so I knew what to do next.. I dont have another map yet, I was just giving myself a sketch while I was at school scripting.. So couldn't test it yet :p


Try this.
void Look_at_corpse(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("corpse_male_torso_1", 100, 100, "");
AddTimer("LookNext", 1, "Timer_Next_2");
}

void Timer_Next_2(string &in asTimer)
{
StopPlayerLookAt();
StartPlayerLookAt("chest_of_drawers_nice_broken_1", 100, 100, "");
AddTimer("LookNext3", 1, "Timer_Next_3");
}

void Timer_Next_3(string &in asTimer)
{
StopPlayerLookAt();
StartPlayerLookAt("painting03_1", 100, 100, "");
SetEntityPlayerLookAtCallback("painting03_1", "Function_Sanity", true);
}


void Function_Sanity(string &in asEntity, string &in asTimer)
{
SetPlayerSanity(0);
FadeOut(5);
AddTimer("newmap", 5, "Change_Map");
}


void Change_Map(string &in asEntity)
{
StopPlayerLookAt();
ChangeMap("new2.map", "Player_startPos_1", "", "");
}

06-15-2012, 12:16 PM
Find
pdkgaming Offline
Junior Member

Posts: 16
Threads: 3
Joined: Jun 2012
Reputation: 0
#27
RE: Please help me :(

(06-15-2012, 12:16 PM)GrAVit Wrote:
(06-14-2012, 07:01 PM)pdkgaming Wrote: okay.. worked on it a bit and changed the script.. It is easier to read now but the same problem is still there... here is the part of the script where it is supposed to look at 3 different entities.. though it still watches at "corpse_male_torso_1" I don't see a problem... So here I am.. asking for help again >.<


void Look_at_corpse(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("corpse_male_torso_1", 100, 100, "Function_corpse");
}

void Function_corpse(string &in asTimer)
{
AddTimer("LookNext", 1, "Timer_Next_2");
}

void Timer_Next_2(string &in asEntity)
{
StartPlayerLookAt("chest_of_drawers_nice_broken_1", 100, 100, "Function_painting");
}

void Function_painting(string &in asTimer)
{
AddTimer("LookNext3", 1, "Timer_Next_3");
}

void Timer_Next_3(string &in asEntity)
{
StartPlayerLookAt("painting03_1", 100, 100, "Function_Sanity");
}

void Function_Sanity(string &in asEntity, string &in asTimer)
{
SetPlayerSanity(0);
FadeOut(5);
AddTimer("newmap", 5, "Change_Map");
}

void Change_Map(string &in asEntity)
{
ChangeMap("new2.map", "Player_startPos_1", "", "");
}

Owh btw... dont mind the change_map function.. that was just for myself so I knew what to do next.. I dont have another map yet, I was just giving myself a sketch while I was at school scripting.. So couldn't test it yet :p


Try this.
void Look_at_corpse(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("corpse_male_torso_1", 100, 100, "");
AddTimer("LookNext", 1, "Timer_Next_2");
}

void Timer_Next_2(string &in asTimer)
{
StopPlayerLookAt();
StartPlayerLookAt("chest_of_drawers_nice_broken_1", 100, 100, "");
AddTimer("LookNext3", 1, "Timer_Next_3");
}

void Timer_Next_3(string &in asTimer)
{
StopPlayerLookAt();
StartPlayerLookAt("painting03_1", 100, 100, "");
SetEntityPlayerLookAtCallback("painting03_1", "Function_Sanity", true);
}


void Function_Sanity(string &in asEntity, string &in asTimer)
{
SetPlayerSanity(0);
FadeOut(5);
AddTimer("newmap", 5, "Change_Map");
}


void Change_Map(string &in asEntity)
{
StopPlayerLookAt();
ChangeMap("new2.map", "Player_startPos_1", "", "");
}


Works for a bit.. It looks at the corps and at the chest of drawers etc. but stops looking from there and doesn't go to the painting.. the name of the entity is right in the script... So I don't know what's wrong.. Sad
Owh and sorry for late reply... I didn't get a notification :o

Map tester
CS creator (beginner)
Youtube:
http://www.youtube.com/pdkgaming
(This post was last modified: 06-18-2012, 10:06 PM by pdkgaming.)
06-18-2012, 10:05 PM
Website Find
GrAVit Offline
Senior Member

Posts: 580
Threads: 15
Joined: Oct 2011
Reputation: 22
#28
RE: Please help me :(

Try replacing the painting with some other entity, like a pot, and rename the pot as painting03_1. Just to see if it's a problem with the entity itself.

06-19-2012, 01:57 PM
Find




Users browsing this thread: 1 Guest(s)