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


Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Simple Memento with item
RedFiction12 Offline
Junior Member

Posts: 9
Threads: 2
Joined: Jul 2012
Reputation: 0
#1
Simple Memento with item

Hey! I am really new at coding amnesia scripts and please try to understand me.

I would like if player steps into certain area (ex. memento1), then he receives memento which tells him to find lantern. Quest completes when player finds this lamp and picks it up into his inventory.

I know this is simple to you guys, but i cant do it myself...thanks anyways if someones takes time to help me. Cheers.
07-03-2012, 04:39 PM
Website Find
Strembitsky Offline
Senior Member

Posts: 254
Threads: 37
Joined: Feb 2012
Reputation: 3
#2
RE: Simple Memento with item

Use AddEntityCollideCallback, and then use the function AddQuest.

The Nightmares v1.0 - Dreadful Fires WIP
07-03-2012, 04:58 PM
Find
RedFiction12 Offline
Junior Member

Posts: 9
Threads: 2
Joined: Jul 2012
Reputation: 0
#3
RE: Simple Memento with item

(07-03-2012, 04:58 PM)Strembitsky Wrote: Use AddEntityCollideCallback, and then use the function AddQuest.

My lantern name is "lantern_1"


Okay, so is it:


.hps

OnStart

{
        AddEntityCollideCallback("Player", "FindLantern_Quest_Area", "GetFindLanternQuest", true, 1);
        AddEntityCollideCallback("Player", "lantern_1", "FinishFindLanternQuest", true, 1);
}

void GetFindLanternQuest(string& asName, string& asNameAndTextEntry)

    {
        AddQuest("findlanternquest", "FindLanternQuest");
    }
    
void FinishFindLanternQuest(string& asName, string& asNameAndTextEntry)

    {
        CompleteQuest("findlanternquest", "FindLanternQuest");
    }
.lang

<CATEGORY Name="Journal">
        <Entry Name="Quest_FindLanternQuest_Text">Find yourself some kind of source of light</Entry>
   </CATEGORY>

, but some how its not working.
(This post was last modified: 07-03-2012, 06:32 PM by RedFiction12.)
07-03-2012, 06:25 PM
Website Find
ZyLogicX Offline
Member

Posts: 245
Threads: 24
Joined: May 2011
Reputation: 6
#4
RE: Simple Memento with item

void OnStart()
{
     AddEntityCollideCallback("Player", "FindLantern_Quest_Area", "GetFindLanternQuest", true,1);
     AddEntityCollideCallback("Player", "lantern_1", "FinishFindLanternQuest", true, 1);
}

void GetFindLanternQuest(string& asName, string& asNameAndTextEntry)
    {
        AddQuest("findlanternquest", "FindLanternQuest");
    }

void FinishFindLanternQuest(string& asName, string& asNameAndTextEntry)
    {
        CompleteQuest("findlanternquest", "FindLanternQuest");
    }

That should work

Beyond the Mountains of Madness [15%]
This forum is dying.
(This post was last modified: 07-03-2012, 06:44 PM by ZyLogicX.)
07-03-2012, 06:43 PM
Find
RedFiction12 Offline
Junior Member

Posts: 9
Threads: 2
Joined: Jul 2012
Reputation: 0
#5
RE: Simple Memento with item

(07-03-2012, 06:43 PM)ZyLogicX Wrote:
void OnStart()
{
     AddEntityCollideCallback("Player", "FindLantern_Quest_Area", "GetFindLanternQuest", true,1);
     AddEntityCollideCallback("Player", "lantern_1", "FinishFindLanternQuest", true, 1);
}

void GetFindLanternQuest(string& asName, string& asNameAndTextEntry)
    {
        AddQuest("findlanternquest", "FindLanternQuest");
    }

void FinishFindLanternQuest(string& asName, string& asNameAndTextEntry)
    {
        CompleteQuest("findlanternquest", "FindLanternQuest");
    }

That should work
I dont know what is wrong, but it dont work either.

Maybe i just copy & paste whole files.

.hps : http://pastebin.com/yf1HsKgc
.lang : http://pastebin.com/WYtXW0JF
.pictures : http://imgur.com/6Drc4,gvyXH

and !notice: i changed lantern_1 to Lantern
(This post was last modified: 07-03-2012, 07:28 PM by RedFiction12.)
07-03-2012, 07:20 PM
Website Find
Mackiiboy Offline
Member

Posts: 101
Threads: 7
Joined: Jan 2012
Reputation: 11
#6
RE: Simple Memento with item

Use this:

void OnStart()
{
SetEntityCallbackFunc("Lantern", "FinishFindLanternQuest");
}

void FinishFindLanternQuest(string &in entity, string &in type)
{
if(type == "OnPickup")
{
CompleteQuest("findlanternquest", "FindLanternQuest");
}
}
(This post was last modified: 07-03-2012, 07:41 PM by Mackiiboy.)
07-03-2012, 07:33 PM
Website Find
RedFiction12 Offline
Junior Member

Posts: 9
Threads: 2
Joined: Jul 2012
Reputation: 0
#7
RE: Simple Memento with item

Nope, it isnt working.
07-03-2012, 07:44 PM
Website Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#8
RE: Simple Memento with item

Are the HPS and MAP files named the same, then? If nothing here works, then i would expect that they aren't.

Tutorials: From Noob to Pro
07-03-2012, 07:48 PM
Website Find
RedFiction12 Offline
Junior Member

Posts: 9
Threads: 2
Joined: Jul 2012
Reputation: 0
#9
RE: Simple Memento with item

Yes they are. My other codes work like they should (ex. Message, MonsterFunction). It seems that i cant copy and paste correctly, bad instructions or there is no way to do it, but i think its reason number 1 so. thats why i copied everything and paste it under here, so you people can check it.


.hps :

void OnStart()
    {

        AddEntityCollideCallback("Player", "FindLantern_Quest_Area", "GetFindLanternQuest", true,1);
        SetEntityCallbackFunc("Lantern", "FinishFindLanternQuest");
        
    }

void GetFindLanternQuest(string& asName, string& asNameAndTextEntry)
    {
        AddQuest("findlanternquest", "FindLanternQuest");
    }

void FinishFindLanternQuest(string &in entity, string &in type)
    {
    if(type == "OnPickup")
        {
            CompleteQuest("findlanternquest", "FindLanternQuest");
        }
    }


.lang

<LANGUAGE>

   <CATEGORY Name="CustomStoryMain">
      <Entry Name="Description">
         Test
      </Entry>
   </CATEGORY>
  
   <CATEGORY Name="Journal">
        <Entry Name="Quest_FindLanternQuest_Text">Find yourself some kind of source light</Entry>    
   </CATEGORY>
    
   <CATEGORY Name="Messages">
        <Entry Name="Message1">"Damn its dark here...need to find some kind of light source."</Entry>    
   </CATEGORY>
  
</LANGUAGE>
(This post was last modified: 07-03-2012, 07:57 PM by RedFiction12.)
07-03-2012, 07:56 PM
Website Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#10
RE: Simple Memento with item

Change:
void GetFindLanternQuest(string& asName, string& asNameAndTextEntry)

to
void GetFindLanternQuest(string&in asName, string&in asNameAndTextEntry, int state)

Tutorials: From Noob to Pro
07-03-2012, 08:08 PM
Website Find




Users browsing this thread: 1 Guest(s)