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
Looking at my picture h???
VisualTech48 Offline
Junior Member

Posts: 21
Threads: 5
Joined: Apr 2012
Reputation: 0
#1
Looking at my picture h???

Well, im deving my custom story and i want to create this scene:
1. Player enters the room
2. He lookes at a picture and trigers an event
3. Grunt comes in the room
Problem: I need a script for looking an an entety to triger the event
You will be credited for this help(who ever helps Smile )

- Order and Law! - The new Mod[WIP]
(This post was last modified: 04-30-2012, 01:13 AM by VisualTech48.)
04-29-2012, 06:39 PM
Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#2
RE: Looking at my picture h???

A quick browse at the functions wiki page reveals:
void SetEntityPlayerLookAtCallback(string& asName, string& asCallback, bool abRemoveWhenLookedAt);




Noob scripting tutorial: From Noob to Pro

04-29-2012, 06:46 PM
Find
VisualTech48 Offline
Junior Member

Posts: 21
Threads: 5
Joined: Apr 2012
Reputation: 0
#3
RE: Looking at my picture h???

can you make me an exampe becouse it says "UnExpected end of line" and i checked everything is allright,,but it dosent work the picture name is : wompic

- Order and Law! - The new Mod[WIP]
04-29-2012, 07:32 PM
Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#4
RE: Looking at my picture h???

(04-29-2012, 07:32 PM)VisualTech48 Wrote: can you make me an exampe becouse it says "UnExpected end of line" and i checked everything is allright,,but it dosent work the picture name is : wompic
The line doesn't work in itself. It was just a description of a function which you can find and read about on the Amnesia wiki page (in the link). I don't script entire examples - sorry.


Noob scripting tutorial: From Noob to Pro

04-29-2012, 07:41 PM
Find
VisualTech48 Offline
Junior Member

Posts: 21
Threads: 5
Joined: Apr 2012
Reputation: 0
#5
RE: Looking at my picture h???

well i configed it all but i dosent work, can anyone make an example of the script?
this is my script: well the part of it
{

SetEntityPlayerLookAtCallback("wowpic", "look", false);
}
void look(string &in asEntity, int alState)
{
SetEntityActive("servant_brute_2, true);
}

- Order and Law! - The new Mod[WIP]
(This post was last modified: 04-29-2012, 08:29 PM by VisualTech48.)
04-29-2012, 08:28 PM
Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#6
RE: Looking at my picture h???

"wowpic"? I thought you said it was named "wompic"? Mis-type?



Noob scripting tutorial: From Noob to Pro

04-29-2012, 09:08 PM
Find
VisualTech48 Offline
Junior Member

Posts: 21
Threads: 5
Joined: Apr 2012
Reputation: 0
#7
RE: Looking at my picture h???

(04-29-2012, 09:08 PM)Cranky Old Man Wrote: "wowpic"? I thought you said it was named "wompic"? Mis-type?
i corrected it but no luck, error

- Order and Law! - The new Mod[WIP]
04-29-2012, 11:34 PM
Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#8
RE: Looking at my picture h???


Typo at this line too:
SetEntityActive("servant_brute_2, true);

(You should be able to spot it.)


Noob scripting tutorial: From Noob to Pro

04-29-2012, 11:35 PM
Find
VisualTech48 Offline
Junior Member

Posts: 21
Threads: 5
Joined: Apr 2012
Reputation: 0
#9
RE: Looking at my picture h???

(04-29-2012, 11:35 PM)Cranky Old Man Wrote: Typo at this line too:
SetEntityActive("servant_brute_2, true);

(You should be able to spot it.)
well im not getting the error anymore but the script doesn't work...THIS is my script

void OnStart()
{
SetEntityPlayerLookAtCallback("Arm", "look", false);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddEntityCollideCallback("armchair_11", "ScriptArea_1", "glass", true, 1);
AddEntityCollideCallback("Player", "Message_1", "Message1", true, 1);
AddUseItemCallback("", "doorkey_1", "maindoor_1", "UsedKeyOnDoor", true);
SetEntityPlayerInteractCallback("doorkey_1", "Spawn_Monster", true);
AddEntityCollideCallback("Player", "PlayerCollide_2", "MonsterFunction1", true, 1);
AddEntityCollideCallback("Player", "Message_2", "Message2", true, 1);

}
void look(string& asName, string& asCallback, bool abRemoveWhenLookedAt)
{
SetEntityActive("wowpic", true);
GiveSanityDamage(30.0f, true);
}


- Order and Law! - The new Mod[WIP]
04-29-2012, 11:51 PM
Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#10
RE: Looking at my picture h???

(04-29-2012, 11:51 PM)VisualTech48 Wrote:
(04-29-2012, 11:35 PM)Cranky Old Man Wrote: Typo at this line too:
SetEntityActive("servant_brute_2, true);

(You should be able to spot it.)
well im not getting the error anymore but the script doesn't work...THIS is my script

void OnStart()
{
SetEntityPlayerLookAtCallback("Arm", "look", false);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddEntityCollideCallback("armchair_11", "ScriptArea_1", "glass", true, 1);
AddEntityCollideCallback("Player", "Message_1", "Message1", true, 1);
AddUseItemCallback("", "doorkey_1", "maindoor_1", "UsedKeyOnDoor", true);
SetEntityPlayerInteractCallback("doorkey_1", "Spawn_Monster", true);
AddEntityCollideCallback("Player", "PlayerCollide_2", "MonsterFunction1", true, 1);
AddEntityCollideCallback("Player", "Message_2", "Message2", true, 1);

}
void look(string& asName, string& asCallback, bool abRemoveWhenLookedAt)
{
SetEntityActive("wowpic", true);
GiveSanityDamage(30.0f, true);
}

You are using the wrong callback. Write this instead:
void look(string &in asEntity, int alState)
{
SetEntityActive("wowpic", true);
GiveSanityDamage(30.0f, true);
}

Noob scripting tutorial: From Noob to Pro

04-30-2012, 12:09 AM
Find




Users browsing this thread: 1 Guest(s)