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
Script Help Offering Script Help
GoranGaming Offline
Member

Posts: 183
Threads: 30
Joined: Feb 2012
Reputation: 7
#1
Offering Script Help

It is summer holidays, I have nothing to do. So, if you need help with any scripts I can help you. Just PM me and I will see what I can do Smile

Current projects:

The Dark Prison 85 % (Stopped working on this one)

Unnamed Project 7 %
06-25-2012, 09:11 PM
Website Find
MaZiCUT Offline
Senior Member

Posts: 536
Threads: 31
Joined: Jun 2012
Reputation: 17
#2
RE: Offering Script Help

You should start working on my friend Jagsr28 custom story, He usually ends up shitting up his script and he's a beginner at it, he could use alot of help.

Hi.
06-25-2012, 09:13 PM
Website Find
GoranGaming Offline
Member

Posts: 183
Threads: 30
Joined: Feb 2012
Reputation: 7
#3
RE: Offering Script Help

If he contacts me I can help Smile

Current projects:

The Dark Prison 85 % (Stopped working on this one)

Unnamed Project 7 %
06-25-2012, 09:14 PM
Website Find
GoranGaming Offline
Member

Posts: 183
Threads: 30
Joined: Feb 2012
Reputation: 7
#4
RE: Offering Script Help

Anyone else?

Current projects:

The Dark Prison 85 % (Stopped working on this one)

Unnamed Project 7 %
06-25-2012, 11:23 PM
Website Find
ModestWalrus Offline
Junior Member

Posts: 26
Threads: 3
Joined: Jan 2012
Reputation: 0
#5
RE: Offering Script Help

I am trying to get a hang of how to make a key unlock a door, I got the extra_english.lang working but now its just not functioning. If you can help me out, ill love you forever.

[Image: modestwalrus.gif]
(This post was last modified: 06-25-2012, 11:37 PM by ModestWalrus.)
06-25-2012, 11:26 PM
Website Find
Demondays1 Offline
Member

Posts: 57
Threads: 7
Joined: Jun 2012
Reputation: 0
#6
RE: Offering Script Help

(06-25-2012, 11:26 PM)ModestWalrus Wrote: I am trying to get a hang of how to make a key unlock a door, I got the extra_english.lang working but now its just not functioning. If you can help me out, ill love you forever.

Try this:

void OnEnter()

{


AddUseItemCallback("", "Key'sname_1", "Nameofdoor", "UsedKeyOnDoor", true);

}

void UsedKeyOnDoor(string &in item, string &in door)

{

SetSwingDoorLocked("Nameofdoor", false, true);

PlaySoundAtEntity("", "unlock_door", "Nameofdoor", 0, false);

RemoveItem("Key'sname_1");

}

Key's name is the name of the key and nameofdoor is the name of the door you want the key to unlock to.




hope I helped.

Intel HD Lag fix: tiny.cc/pyv1gw
(This post was last modified: 06-26-2012, 03:02 AM by Demondays1.)
06-26-2012, 03:01 AM
Find
ApeCake Offline
Member

Posts: 116
Threads: 20
Joined: Jun 2012
Reputation: 4
#7
RE: Offering Script Help

You got summer holidays... dangit. I have still one week exams left D:

Anyway, in my very first map (it was a test map) I had some trouble regarding levers. They wouldn't stay up if I pulled them and same story when I pulled them down. I know I can change some part of that in the entity section of the lever - but I still couldn't figure it out. Any advice? I do have the script set out already... copied from the wiki.
void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
AddLocalVarInt("Var1", 1);
func01();
}
}


void func_shelf_1(string &in asEntity, int alState)
{
if (alState == 1)
{
AddLocalVarInt("Var1", 1);
func01();
}
}


void func01()
{
if(GetLocalVarInt("Var1") == 2)
{
SetMoveObjectState("shelf",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf", 0, false);
}
}

However, here's my REAL question; is there any way of detecting if a lamp is lit or not? In script sense, that is.
06-26-2012, 05:04 PM
Find
GoranGaming Offline
Member

Posts: 183
Threads: 30
Joined: Feb 2012
Reputation: 7
#8
RE: Offering Script Help

(06-26-2012, 05:04 PM)ApeCake Wrote: You got summer holidays... dangit. I have still one week exams left D:

Anyway, in my very first map (it was a test map) I had some trouble regarding levers. They wouldn't stay up if I pulled them and same story when I pulled them down. I know I can change some part of that in the entity section of the lever - but I still couldn't figure it out. Any advice? I do have the script set out already... copied from the wiki.
void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
AddLocalVarInt("Var1", 1);
func01();
}
}


void func_shelf_1(string &in asEntity, int alState)
{
if (alState == 1)
{
AddLocalVarInt("Var1", 1);
func01();
}
}


void func01()
{
if(GetLocalVarInt("Var1") == 2)
{
SetMoveObjectState("shelf",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf", 0, false);
}
}

However, here's my REAL question; is there any way of detecting if a lamp is lit or not? In script sense, that is.
I have a better version of that script, in the script you use there is an really annoying bug. Try this instead:

void func_shelf(string &in asEntity, int alState)
{
if(alState == 1){
SetLocalVarInt("Lever1", 1);
}
}


void func_shelf_1(string &in asEntity, int alState)
{
if(alState == 1){
SetLocalVarInt("Lever2", 1);
}
}

void func01()
{
if(GetLocalVarInt("Lever1") ==1 && GetLocalVarInt("Lever2") == 1){
SetMoveObjectState("shelf",1.0f); PlaySoundAtEntity("", "quest_completed.snt", "shelf", 0, false);
}
}
Yes there is, you can use LocalVarInt's like:

void LitLamp(string &in asParent, string &in asChild, int alState)
{
SetLampLit("Lamp1", true, false);
SetLocalVarInt("Lamp1", 1);
}

Then you can check with "GetLocalVarInt".

Any questions?

Current projects:

The Dark Prison 85 % (Stopped working on this one)

Unnamed Project 7 %
06-26-2012, 05:42 PM
Website Find




Users browsing this thread: 1 Guest(s)