Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Thread Closed 
 
Thread Rating:
  • 16 Votes - 4.44 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripts Recollection
Author Message
house Offline
Member

Posts: 195
Joined: Oct 2010
Reputation: 1
Post: #41
RE: Scripts Recollection
(01-10-2011 11:04 PM)Tony32 Wrote:  Hmm. Can anyone explain/tell me which function is used to trigger something when an item is picked up?
ex. When I pickup a bowl, something will happen. (NOT when I use the bowl)

Thanks.

Heres the code:

if(HasItem("NAME OF ITEM") == true) {
Bla Bla Stuff Here        
}

Example:

void OnStart()
{
if(HasItem("cutter_1") == true) {
        
bla bla

        }
}
(This post was last modified: 01-11-2011 12:01 AM by house.)
01-10-2011 11:59 PM
Find all posts by this user
Tony32 Offline
Junior Member

Posts: 24
Joined: Jan 2011
Reputation: 0
Post: #42
RE: Scripts Recollection
(01-10-2011 11:59 PM)house Wrote:  Heres the code:

if(HasItem("NAME OF ITEM") == true) {
Bla Bla Stuff Here        
}

Example:

void OnStart()
{
if(HasItem("cutter_1") == true) {
        
bla bla

        }
}

Thank you. Is that the correct way to do it? I did something else to make it work, but I aint sure if it's the correct one. I did it like this:
void OnStart()
{
SetEntityCallbackFunc("Storage_Key","PickUpKeyStorage");
}

then the PickUpKeyStorage function:
    //Pick up storage key
    void  PickUpKeyStorage(string& asName, string& asCallback)
    {
        AddDebugMessage("Picked up the Storage Key.", false);
    }

It surely works perfect, but is it correct? Tongue
Thanks!
01-11-2011 02:37 PM
Find all posts by this user
Tony32 Offline
Junior Member

Posts: 24
Joined: Jan 2011
Reputation: 0
Post: #43
RE: Scripts Recollection
I think this thread should be stickied. Great source of info :Shy
01-13-2011 04:21 PM
Find all posts by this user
Seragath Offline
Junior Member

Posts: 34
Joined: Jan 2011
Reputation: 0
Post: #44
RE: Scripts Recollection
Agreed, what the above post said.
01-13-2011 04:32 PM
Find all posts by this user
Frontcannon Offline
Senior Member

Posts: 538
Joined: Jul 2010
Reputation: 0
Post: #45
RE: Scripts Recollection
(01-11-2011 02:37 PM)Tony32 Wrote:  
void OnStart()
{
SetEntityCallbackFunc("Storage_Key","PickUpKeyStorage");
}

then the PickUpKeyStorage function:
    //Pick up storage key
    void  PickUpKeyStorage(string& asName, string& asCallback)
    {
        AddDebugMessage("Picked up the Storage Key.", false);
    }

It surely works perfect, but is it correct? Tongue
Thanks!

You could alternatively just write PickUpKeyStorage in the callback field of the key.


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
01-13-2011 05:09 PM
Find all posts by this user
Akumasama Offline
Member

Posts: 122
Joined: Nov 2010
Reputation: 0
Post: #46
RE: Scripts Recollection
Is the creator of this thread still active on the forum?
Or else we might wanna recreate the thread so it can be edited.
01-15-2011 06:25 PM
Find all posts by this user
Frontcannon Offline
Senior Member

Posts: 538
Joined: Jul 2010
Reputation: 0
Post: #47
RE: Scripts Recollection
(01-15-2011 06:25 PM)Akumasama Wrote:  Is the creator of this thread still active on the forum?
Or else we might wanna recreate the thread so it can be edited.

Currently doing this, would you mind making the 2nd post? If we have a character limit on this forum we might need a 2nd post.


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
01-15-2011 08:34 PM
Find all posts by this user
Akumasama Offline
Member

Posts: 122
Joined: Nov 2010
Reputation: 0
Post: #48
RE: Scripts Recollection
Do you mean that I make the second post on the topic or...?
If so, tell me when you're going to make it so I can post quickly Smile

And I'll be on everyday to check for new stuff ofcourse.
01-18-2011 05:51 PM
Find all posts by this user
Ianlis Offline
Junior Member

Posts: 10
Joined: Jan 2011
Reputation: 0
Post: #49
RE: Scripts Recollection
How about something for those of us that don't know heads or tails about programming, and don't even wanna try to learn?
01-21-2011 11:45 PM
Find all posts by this user
Akumasama Offline
Member

Posts: 122
Joined: Nov 2010
Reputation: 0
Post: #50
RE: Scripts Recollection
(01-21-2011 11:45 PM)Ianlis Wrote:  How about something for those of us that don't know heads or tails about programming, and don't even wanna try to learn?

They don't deserve to make levels.
Or any other kind of game that needs scripting/coding to make something.
01-22-2011 01:20 AM
Find all posts by this user
Thread Closed 




User(s) browsing this thread: 1 Guest(s)