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


Thread Rating:
  • 16 Vote(s) - 4.44 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripts Recollection
house Offline
Member

Posts: 195
Threads: 11
Joined: Oct 2010
Reputation: 1
#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
Tony32 Offline
Junior Member

Posts: 26
Threads: 2
Joined: Jan 2011
Reputation: 0
#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? :p
Thanks!
01-11-2011, 02:37 PM
Find
Tony32 Offline
Junior Member

Posts: 26
Threads: 2
Joined: Jan 2011
Reputation: 0
#43
RE: Scripts Recollection

I think this thread should be stickied. Great source of info :Shy
01-13-2011, 04:21 PM
Find
Seragath Offline
Junior Member

Posts: 34
Threads: 1
Joined: Jan 2011
Reputation: 0
#44
RE: Scripts Recollection

Agreed, what the above post said.
01-13-2011, 04:32 PM
Find
Frontcannon Offline
Senior Member

Posts: 538
Threads: 10
Joined: Jul 2010
Reputation: 2
#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? :p
Thanks!

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


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
01-13-2011, 05:09 PM
Find
Akumasama Offline
Member

Posts: 122
Threads: 2
Joined: Nov 2010
Reputation: 0
#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
Frontcannon Offline
Senior Member

Posts: 538
Threads: 10
Joined: Jul 2010
Reputation: 2
#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
Akumasama Offline
Member

Posts: 122
Threads: 2
Joined: Nov 2010
Reputation: 0
#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
Ianlis Offline
Junior Member

Posts: 10
Threads: 4
Joined: Jan 2011
Reputation: 0
#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
Akumasama Offline
Member

Posts: 122
Threads: 2
Joined: Nov 2010
Reputation: 0
#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




Users browsing this thread: 1 Guest(s)