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
Scripting Queries
bored2tears Offline
Member

Posts: 56
Threads: 6
Joined: Jun 2012
Reputation: 3
#2
RE: Scripting Queries

(06-24-2012, 03:36 PM)bored2tears Wrote:
(06-24-2012, 03:27 PM)JesterTone Wrote: Basically, as I suck at the moment with scripting and it's a touch too confusing - even though I've read the script tutorials on the wiki.frictionalgames webpage - so I'll be sticking my confusion all in here to keep it together.

First up; locked doors and keys. I have my key and door and such set up. Now heres the script I have -

void OnStart()
{
AddUseItemCallback("", "Key_1", "corridor_door1", "open_CD1", true);
}

void open_CD1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", "corridor_door1", 0, false);
RemoveItem(asItem);
}

void OnEnter()
{
}

void OnLeave()
{
}

Now is there something I need to change or delete or add?

A second much smaller question - I have a painting I want to make moveable. Is there a specific painting I need to use?

Thank you and if I have anymore, I'll be sure to change this first post and bump up.

Thanks all.
Use this instead:

void open_CD1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("corridor_door1", false, true);
PlaySoundAtEntity("", "unlock_door", "corridor_door1", 0, false);
RemoveItem("Key_1");
}



You need to set asEntity and asItem as the names of the entity/item, I believe.
(This post was last modified: 06-24-2012, 03:37 PM by bored2tears.)
06-24-2012, 03:36 PM
Find


Messages In This Thread
Scripting Queries - by JesterTone - 06-24-2012, 03:27 PM
RE: Scripting Queries - by bored2tears - 06-24-2012, 03:36 PM
RE: Scripting Queries - by JesterTone - 06-24-2012, 03:51 PM
RE: Scripting Queries - by bored2tears - 06-24-2012, 04:24 PM
RE: Scripting Queries - by JesterTone - 06-24-2012, 04:39 PM
RE: Scripting Queries - by bored2tears - 06-24-2012, 04:41 PM
RE: Scripting Queries - by JesterTone - 06-24-2012, 05:00 PM
RE: Scripting Queries - by bored2tears - 06-24-2012, 05:14 PM
RE: Scripting Queries - by Cruzore - 06-24-2012, 06:24 PM



Users browsing this thread: 1 Guest(s)