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
tezpull666 Away
Banned

Posts: 286
Threads: 15
Joined: May 2013
#11
RE: Script help

(05-27-2013, 07:15 PM)Kullin Wrote: The error is in line 19, And 37 the first letter of the word with a error so yea your right bridge,

But it says that it can't find the door, so make sure the door name is right. AND PRESS ENTER WHEN YOU ENTER A NAME IN THE LEVEL EDITITOR'!! Haha just so you see that!

And post the whole script, because a script. with 11 lines cant give a error on line 19. So give the whole script..

Whait a second, I just realised that on line 19 it gives a error because it says "door" in the script, do you understand what I mean? ( I know your from Germany)
I am from the netherlands. I still didn't understand that. Can you send the code to me??
05-28-2013, 03:35 PM
Find
Bridge Offline
Posting Freak

Posts: 1,971
Threads: 25
Joined: May 2012
Reputation: 128
#12
RE: Script help

What are you talking about? You're supposed to have the code. Where is the rest of it?
05-28-2013, 04:45 PM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#13
RE: Script help

You won't ever receive an error if you provide the wrong name for an entity in your map - it just won't work

The problem is on this line...

PlayGuiSound("unlock_door.snt", door, 0, false);

You use the name 'door' as though it is a variable - that is why it is complaining that door has not been declared, it's expecting a variable called door, and there isn't one

Regardless, that function call is incorrect

void PlayGuiSound(string& asSoundFile, float afVolume);

Plays a sound, not using 3D.
asSoundFile - the sound to play (extension is .snt)
afVolume - the volume of the sound

It looks like you want to use the PlaySoundAtEntity function, not PlayGuiSound, and provide either the name of a valid variable, in this case asEntity being the door that the key is used on, or you can use the literal name of the door "level_wood_1"

void FUNCTION(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("level_wood_1", false);
    PlaySoundAtEntity("unlock_door.snt", asEntity, 0, false);
    RemoveItem("key_tomb_rusty_1");
}

(This post was last modified: 05-28-2013, 05:42 PM by Adrianis.)
05-28-2013, 05:33 PM
Find
tezpull666 Away
Banned

Posts: 286
Threads: 15
Joined: May 2013
#14
RE: Script help

(05-28-2013, 05:33 PM)Adrianis Wrote: You won't ever receive an error if you provide the wrong name for an entity in your map - it just won't work

The problem is on this line...

PlayGuiSound("unlock_door.snt", door, 0, false);

You use the name 'door' as though it is a variable - that is why it is complaining that door has not been declared, it's expecting a variable called door, and there isn't one

Regardless, that function call is incorrect

void PlayGuiSound(string& asSoundFile, float afVolume);

Plays a sound, not using 3D.
asSoundFile - the sound to play (extension is .snt)
afVolume - the volume of the sound

It looks like you want to use the PlaySoundAtEntity function, not PlayGuiSound, and provide either the name of a valid variable, in this case asEntity being the door that the key is used on, or you can use the literal name of the door "level_wood_1"

void FUNCTION(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("level_wood_1", false);
    PlaySoundAtEntity("unlock_door.snt", asEntity, 0, false);
    RemoveItem("key_tomb_rusty_1");
}
It now say this:

[Image: c1lhwS9]

Are you guys just playing a trick on me!?> Angry
(This post was last modified: 05-28-2013, 05:58 PM by tezpull666.)
05-28-2013, 05:58 PM
Find
amnesiaplayer321 Offline
Junior Member

Posts: 31
Threads: 4
Joined: May 2013
Reputation: 0
#15
RE: Script help

Derp.
(This post was last modified: 05-28-2013, 06:27 PM by amnesiaplayer321.)
05-28-2013, 06:00 PM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#16
RE: Script help

Oh my bad, there's an extra parameter missing

Change the line so it reads

PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);

It might be worth noting, for your benefit, that when people are trying to help you they are not trying to trick you, and getting angry at them is not going to make them want to help you more. We all make mistakes

(This post was last modified: 05-28-2013, 06:07 PM by Adrianis.)
05-28-2013, 06:06 PM
Find
tezpull666 Away
Banned

Posts: 286
Threads: 15
Joined: May 2013
#17
RE: Script help

(05-28-2013, 06:06 PM)Adrianis Wrote: Oh my bad, there's an extra parameter missing

Change the line so it reads

PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);

It might be worth noting, for your benefit, that when people are trying to help you they are not trying to trick you, and getting angry at them is not going to make them want to help you more. We all make mistakes
THANKS IT WORKED!!!!!!!!!!!!
05-28-2013, 06:12 PM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#18
RE: Script help

(05-28-2013, 06:00 PM)amnesiaplayer321 Wrote: how about posting your map file and hps file so people can fix this easily?

You don't need that. Just the full script is enough.
05-28-2013, 06:21 PM
Find
Bridge Offline
Posting Freak

Posts: 1,971
Threads: 25
Joined: May 2012
Reputation: 128
#19
RE: Script help

Mike1265: I suggest that you, and this is a friendly suggestion, read a beginner's programming book or at least a guide on the internet. It's clear you do not understand any of the concepts at play here which is why you do not understand when people are trying to help you.

http://www.cprogramming.com/tutorial/lesson1.html

This one is good, very solid but a bit difficult to understand if you are completely clueless. There are plenty of beginner guides online, you can look for ones with easy language so that you completely understand everything.
05-28-2013, 06:35 PM
Find




Users browsing this thread: 2 Guest(s)