Frictional Games Forum

Full Version: Problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
(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
*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.
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)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.
(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
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()
{

}
(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
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"
(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
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"

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)
[url]http://www.myg.co.il/index.php?loc=see&p...ZNpHIQ.png[/url]
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.
(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.
(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.

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/...

(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.

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/...

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?
Pages: 1 2 3 4