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
help with intro
Death Icarus Offline
Junior Member

Posts: 19
Threads: 8
Joined: Sep 2011
Reputation: 0
#1
help with intro



so ive got this intro made. just need to add one more thing to it, but not sure how.

i want the intro to start with my guy waking up, and getting out of bed. i get everything else i need scripted up.
just dont know how to make it look like the player is laying in bed, then gets out of it. Rather than just spawning next to the bed like i have it now

And also, how to complete a quest when i pick up an item, for example.
the player gets a memo at start, i need to find a lantern. and quest gets completed(memo goes away) when i pick up the lantern. atm i have it set up to completed the quest when i enter the area in front of the lantern
02-01-2012, 04:19 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#2
RE: help with intro

First question: Mess around with these codes:
StartPlayerLookAt(string& asEntityName, float afSpeedMul, float afMaxSpeed, string& asAtTargetCallback);

StopPlayerLookAt();

MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);

You can use this if you want:

FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);

You can find them all at http://wiki.frictionalgames.com/hpl2/amn...ons#player

Question 2: If you already have a quest started then use
CompleteQuest(string& asName, string& asNameAndTextEntry);


02-01-2012, 04:26 PM
Find
Death Icarus Offline
Junior Member

Posts: 19
Threads: 8
Joined: Sep 2011
Reputation: 0
#3
RE: help with intro

ok thanks. i should be able to get my intro now.

but im confused about how to make the quest to complete when i pick up the item.
im new to all this, still learning. So far i only got my quest to complete by entering a script area.

do i have to use SetEntityPlayerInteractCallback("Lantern", "CompleteLantern", true)
then call the function and use CompleteQuest?
02-01-2012, 04:40 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#4
RE: help with intro

(02-01-2012, 04:40 PM)Death Icarus Wrote: ok thanks. i should be able to get my intro now.

but im confused about how to make the quest to complete when i pick up the item.
im new to all this, still learning. So far i only got my quest to complete by entering a script area.

do i have to use SetEntityPlayerInteractCallback("Lantern", "CompleteLantern", true)
then call the function and use CompleteQuest?
Yes Smile


02-01-2012, 04:49 PM
Find
Death Icarus Offline
Junior Member

Posts: 19
Threads: 8
Joined: Sep 2011
Reputation: 0
#5
RE: help with intro

cool =D.

and one more question i just ran into, if i may...


i have a door thats locked, and if you interact with it. you get a quest saying you need a key.
And that quest is tied to a Variable, so when i complete 3 quest in this area, a door unlocks.
but theres a chance that the player can find the key before he finds that locked door to get the quest.
and i also want to have a quest on the key, so when you pick it up you get a quest saying find the door or whatever.
so to my question, how can i set it so the game checks if i have the other quest before it gives me one of them, so i can only get one of the quest.
02-01-2012, 05:04 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#6
RE: help with intro

You need to use LocalVar and stuff, it is though a bit more complicated Smile

02-01-2012, 05:08 PM
Find
Death Icarus Offline
Junior Member

Posts: 19
Threads: 8
Joined: Sep 2011
Reputation: 0
#7
RE: help with intro

ok..so maybe something like this? not really sure


void OnStart()
{
SetLocalVarInt("Var1", 0);
SetEntityPlayerInteractCallback("LockedDoor", "GetQuestDoorLocked");
SetEntityPlayerInteractCallback("Key1", "GetQuestFoundKey");
}

void GetQuestDoorLocked(string& asName, string& asCallback, bool abRemoveOnInteraction)
{
if ("Var1" == 0)
{
AddQuest("DoorLocked", "DoorLocked");
SetLocalVarInt("Var1",1);
}
if ("Var1" ==1)
{
//not really sure what to add here?
}
}

and the same for the key?
02-01-2012, 05:23 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#8
RE: help with intro

Not really I'm going to give you an example that I use in my CS.

This code makes so that when you are touching the door, if it's locked it appears a text but when it's unlocked it doesn't appear a text.

void OnStart()
{
SetLocalVarInt("DoorLocked", 1);
SetEntityPlayerInteractCallback("level_wood_1", "TextLockedDoor", false);
}

void TextLockedDoor(string &in asEntity)
{
if(GetLocalVarInt("DoorLocked") == 1){
SetMessage("Message", "LevelDoorUnlock", 3);
AddQuest("03Books", "03Books");
}
}

(This post was last modified: 02-01-2012, 06:59 PM by SilentStriker.)
02-01-2012, 06:58 PM
Find
Death Icarus Offline
Junior Member

Posts: 19
Threads: 8
Joined: Sep 2011
Reputation: 0
#9
RE: help with intro

thank you
(02-01-2012, 06:58 PM)SilentStriker Wrote: Not really I'm going to give you an example that I use in my CS.

This code makes so that when you are touching the door, if it's locked it appears a text but when it's unlocked it doesn't appear a text.

void OnStart()
{
SetLocalVarInt("DoorLocked", 1);
SetEntityPlayerInteractCallback("level_wood_1", "TextLockedDoor", false);
}

void TextLockedDoor(string &in asEntity)
{
if(GetLocalVarInt("DoorLocked") == 1){
SetMessage("Message", "LevelDoorUnlock", 3);
AddQuest("03Books", "03Books");
}
}

02-01-2012, 07:27 PM
Find




Users browsing this thread: 2 Guest(s)