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


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem
Author Message
darkadders Offline
Junior Member

Posts: 45
Joined: Mar 2012
Reputation: 3
Post: #11
RE: Problem

(05-08-2012 05:06 PM)maitalr Wrote:  
(05-08-2012 04:08 PM)DarkShadowz Wrote:  
(05-08-2012 03:31 PM)maitalr Wrote:  Everything works well. But when I try to open the door with the key, it does not open
so its still locked after you use the key on it?
Yes. its still locked and it say "you cannot use this item that way//.."
(05-08-2012 04:26 PM)Datguy5 Wrote:  I dont think this affects much,but change this PlaySoundAtEntity("", "unlock_door.snt", "Door_3", 0, false); to
PlaySoundAtEntity("", "unlock_door", "Door_3", 0, false);
I just removed the snt from the end.Thats how its in my script and it works fine.Can you show us the whole script(if it has something else).

Also check the names in the level editor.

(05-08-2012 04:08 PM)DarkShadowz Wrote:  
(05-08-2012 03:31 PM)maitalr Wrote:  Everything works well. But when I try to open the door with the key, it does not open
so its still locked after you use the key on it?

I think he means that when he tries to use the key on the door,it says cannot use item this way.

Tried. it didn't work. and i checked the names again.
there isn't. that's the whole script.
I have no idea what i'm doing wrong
and you all probable have no idea what i want
well, for instance you can try adding a scriptarea in the level editor and assign the callback to it

*insert creative signature here*
05-08-2012 05:44 PM
Find all posts by this user Quote this message in a reply
Cranky Old Man Offline
Posting Freak

Posts: 922
Joined: Apr 2012
Reputation: 37
Post: #12
RE: Problem

*butts my head in:* Have you named the key properly in the editor? If you want an online tutorial of the basics of scripting, checkout this one.

Noob scripting tutorial: From Noob to Pro

05-08-2012 05:56 PM
Find all posts by this user Quote this message in a reply
maitalr Offline
Junior Member

Posts: 16
Joined: May 2012
Reputation: 0
Post: #13
RE: Problem

this is really weird. even when i'm try with anther scripts it's still not working. i'm seriously don't know what to do
05-09-2012 12:55 PM
Find all posts by this user Quote this message in a reply
Cranky Old Man Offline
Posting Freak

Posts: 922
Joined: Apr 2012
Reputation: 37
Post: #14
RE: Problem

(05-09-2012 12:55 PM)maitalr Wrote:  this is really weird. even when i'm try with anther scripts it's still not working. i'm seriously don't know what to do
Judging by your grammar, you should start with learning the basics. Just copying and pasting example code, often doesn't work out, and when it doesn't work out, you need to have some understanding of why it doesn't. I should start by saying that scripting isn't easy. If you want better help than that, post what code you're currently using now, and what exactly isn't working now. We can't tell you what's wrong now, just by looking at the old code.

Noob scripting tutorial: From Noob to Pro

05-09-2012 01:03 PM
Find all posts by this user Quote this message in a reply
maitalr Offline
Junior Member

Posts: 16
Joined: May 2012
Reputation: 0
Post: #15
RE: Problem

(05-09-2012 01:03 PM)Cranky Old Man Wrote:  
(05-09-2012 12:55 PM)maitalr Wrote:  this is really weird. even when i'm try with anther scripts it's still not working. i'm seriously don't know what to do
Judging by your grammar, you should start with learning the basics. Just copying and pasting example code, often doesn't work out, and when it doesn't work out, you need to have some understanding of why it doesn't. I should start by saying that scripting isn't easy. If you want better help than that, post what code you're currently using now, and what exactly isn't working now. We can't tell you what's wrong now, just by looking at the old code.
Sorry. English it's not my first language. Is it so obvious?
But still, i'm pretty good at English.

I did copy it, and then i change whats need to.
I tried several times with all the suggestions were here and in youtube[font=arial, sans-serif]
[/font]
That's my script now:




/////////////////////////////////
// Run when entering map
void OnStart()
{
AddUseItemCallback("", "key_1", "Door_3", "UsedKeyOnDoor", true);
}

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

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
(This post was last modified: 05-09-2012 09:27 PM by maitalr.)
05-09-2012 09:25 PM
Find all posts by this user Quote this message in a reply
darkadders Offline
Junior Member

Posts: 45
Joined: Mar 2012
Reputation: 3
Post: #16
RE: Problem

(05-09-2012 09:25 PM)maitalr Wrote:  
(05-09-2012 01:03 PM)Cranky Old Man Wrote:  
(05-09-2012 12:55 PM)maitalr Wrote:  this is really weird. even when i'm try with anther scripts it's still not working. i'm seriously don't know what to do
Judging by your grammar, you should start with learning the basics. Just copying and pasting example code, often doesn't work out, and when it doesn't work out, you need to have some understanding of why it doesn't. I should start by saying that scripting isn't easy. If you want better help than that, post what code you're currently using now, and what exactly isn't working now. We can't tell you what's wrong now, just by looking at the old code.
Sorry. English it's not my first language. Is it so obvious?
But still, i'm pretty good at English.

I did copy it, and then i change whats need to.
I tried several times with all the suggestions were here and in youtube[font=arial, sans-serif]
[/font]
That's my script now:




/////////////////////////////////
// Run when entering map
void OnStart()
{
AddUseItemCallback("", "key_1", "Door_3", "UsedKeyOnDoor", true);
}

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

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
aah i see what youre doing wrong. you put in the function "UsedKeyOnDoor" as a callback, but your void calls back the function of "KeyOnDoor", a function which doesnt exist in your script

simply change your void KeyOnDoor to void UsedKeyOnDoor


ALSO: did you not read what i said? you need an extention for your sound file to be played. put a .snt at the end of your "unlock_door"

*insert creative signature here*
05-09-2012 09:49 PM
Find all posts by this user Quote this message in a reply
maitalr Offline
Junior Member

Posts: 16
Joined: May 2012
Reputation: 0
Post: #17
RE: Problem

(05-09-2012 09:49 PM)DarkShadowz Wrote:  
(05-09-2012 09:25 PM)maitalr Wrote:  
(05-09-2012 01:03 PM)Cranky Old Man Wrote:  
(05-09-2012 12:55 PM)maitalr Wrote:  this is really weird. even when i'm try with anther scripts it's still not working. i'm seriously don't know what to do
Judging by your grammar, you should start with learning the basics. Just copying and pasting example code, often doesn't work out, and when it doesn't work out, you need to have some understanding of why it doesn't. I should start by saying that scripting isn't easy. If you want better help than that, post what code you're currently using now, and what exactly isn't working now. We can't tell you what's wrong now, just by looking at the old code.
Sorry. English it's not my first language. Is it so obvious?
But still, i'm pretty good at English.

I did copy it, and then i change whats need to.
I tried several times with all the suggestions were here and in youtube[font=arial, sans-serif]
[/font]
That's my script now:




/////////////////////////////////
// Run when entering map
void OnStart()
{
AddUseItemCallback("", "key_1", "Door_3", "UsedKeyOnDoor", true);
}

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

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
aah i see what youre doing wrong. you put in the function "UsedKeyOnDoor" as a callback, but your void calls back the function of "KeyOnDoor", a function which doesnt exist in your script

simply change your void KeyOnDoor to void UsedKeyOnDoor


ALSO: did you not read what i said? you need an extention for your sound file to be played. put a .snt at the end of your "unlock_door"
[font=arial, sans-serif]
Not working. I'm going crazy.
By the way I tried what you said, and because it did not work, I put it back.
:/
Any way, here screenshots:
First: the key, custom_story_settings, and script
Second: the door
(You can click on the image to enlarge)
http://www.myg.co.il/index.php?loc=see&p...ZNpHIQ.png
http://www.myg.co.il/index.php?loc=see&p...DW3TOi.png

I swear, it's probably a stupid mistake that I make
And Seriously, Thanks for helping.
[/font]
05-09-2012 10:54 PM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,474
Joined: Jul 2011
Reputation: 234
Post: #18
RE: Problem

(05-09-2012 10:54 PM)maitalr Wrote:  I swear, it's probably a stupid mistake that I make

You have no idea. Big Grin

P.S. You didn't do what he told you to do.

Tutorials: From Noob to Pro
05-09-2012 11:54 PM
Visit this user's website Find all posts by this user Quote this message in a reply
maitalr Offline
Junior Member

Posts: 16
Joined: May 2012
Reputation: 0
Post: #19
RE: Problem

(05-09-2012 11:54 PM)Your Computer Wrote:  
(05-09-2012 10:54 PM)maitalr Wrote:  I swear, it's probably a stupid mistake that I make

You have no idea. Big Grin

P.S. You didn't do what he told you to do.
[font=arial, sans-serif]
[/font]Oh.. ignore that thing its save with what he ask me to do. I made that screenshot before i change that part. cuz' i tried with it and without it. And i checked it again - it is save with the .snt thing
//.. i'm becoming desperate
maybe i should let it go and don't design...
it will be so disappointing/...[font=arial, sans-serif]

[/font]
05-10-2012 12:13 AM
Find all posts by this user Quote this message in a reply
darkadders Offline
Junior Member

Posts: 45
Joined: Mar 2012
Reputation: 3
Post: #20
RE: Problem

(05-10-2012 12:13 AM)maitalr Wrote:  
(05-09-2012 11:54 PM)Your Computer Wrote:  
(05-09-2012 10:54 PM)maitalr Wrote:  I swear, it's probably a stupid mistake that I make

You have no idea. Big Grin

P.S. You didn't do what he told you to do.
[font=arial, sans-serif]
[/font]Oh.. ignore that thing its save with what he ask me to do. I made that screenshot before i change that part. cuz' i tried with it and without it. And i checked it again - it is save with the .snt thing
//.. i'm becoming desperate
maybe i should let it go and don't design...
it will be so disappointing/...[font=arial, sans-serif]

[/font]
dont worry about this dude, we all get stuck sometime. we'll get through it though, so dont worry ^^.


can you give me your current script?

*insert creative signature here*
05-10-2012 07:34 AM
Find all posts by this user Quote this message in a reply
Post Reply 




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