Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Level Editor Help New Question: How to create a door
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#61
RE: 3 Questions: Cave In and Destroying bookshelf

poste that script part?
Edit: Actually, let me explain it like that to you:
the .snt file is not a sound, but a file to modify the settings of it. Also, it chooses which sounds(.ogg's) to play when you play the .snt file. It basically plays a random .ogg within it's reach(edit it with notepad or similiar and you'll see what I mean). If you want to play a specified sound, you can either create a .snt yourself and add it to your custom story folder with a different name, in which you declare only 1 .ogg who is to be played, OR you simply use PlayMusic, in which you choose from which monster to play.
For the example, since it would be hard to understand without:
PlayMusic("brute/amb_idle02.ogg", false, 1, 0, 1, false);
brute can be replaced with grunt or suitor .
This is needed to specify which amb_idle02 to use, since there are 3(1 for each enemy). However, if you "just" want to play the .snt of grunt or brute, look at my next post. If you want to play a certain sound(Like any .ogg), use PlayMusic and the .ogg, if you want to play a random sound from a range(Like 1 of 4 sounds from the grunt), use PlaySoundAtEntity and the .snt. If there is a .snt file for a single .ogg only, you should use the .snt file instead since sounds seem easier to handle than music. So, you should use the .snt if you don't care about random or if it's just 1 anyway, and .ogg if you want a special one out of many, if the sound should loop or if there's no .snt(like background music and such, which should loop)

Think, before you speak Google, before you post
(This post was last modified: 07-04-2012, 02:01 AM by Cruzore.)
07-04-2012, 01:04 AM
Find
Nervly Offline
Junior Member

Posts: 40
Threads: 2
Joined: Feb 2012
Reputation: 0
#62
RE: 3 Questions: Cave In and Destroying bookshelf

(07-04-2012, 01:04 AM)FastHunteR Wrote: poste that script part?
Sorry, I forgot.
I did google it, but couldn't find the solution Confused

Here it is:
Spoiler below!
void OnStart()
{
AddEntityCollideCallback("Player", "pot_area_1", "Look", true, 1);
}
void Look(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "amb_idle", "Player", 0, false);
StartPlayerLookAt("wind_area", 2, 3, "StopPlayerLookAt");
}

I changed to .snt again. When I tried with PlayMusic I had it like this:
Spoiler below!
void OnStart()
{
AddEntityCollideCallback("Player", "pot_area_1", "Look", true, 1);
}
void Look(string &in asParent, string &in asChild, int alState)
{
PlayMusic("amb_idle02", false, 10, 0, 0, false);
StartPlayerLookAt("wind_area", 2, 3, "StopPlayerLookAt");
}

Check it out!
http://www.youtube.com/Nervly

Please?
[Image: please-please-please.jpg]
(This post was last modified: 07-04-2012, 01:18 AM by Nervly.)
07-04-2012, 01:17 AM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#63
RE: 3 Questions: Cave In and Destroying bookshelf

Nevermind, found the way to use the .snt of the grunt/brute only after looking in the main game's archives:
PlaySoundAtEntity("enemy", "enemy/grunt/amb_idle.snt", "AreaDustScrape_6", 0, false);
With this, you specify which enemy to use the .snt from.
Look at my previous post for some explanation, the solution I couldn't find is this one.

Think, before you speak Google, before you post
(This post was last modified: 07-04-2012, 02:05 AM by Cruzore.)
07-04-2012, 01:51 AM
Find
Nervly Offline
Junior Member

Posts: 40
Threads: 2
Joined: Feb 2012
Reputation: 0
#64
RE: 3 Questions: Cave In and Destroying bookshelf

Thanks a lot!
It now plays only the amb_idle02.ogg file I want Smile
It looked like it was playing every .ogg file because it was really weird and long sound.
I used PlayMusic("grunt/amb_idle02.ogg", false, 1, 0, 1, false);

Thanks once again.
+1 Rep

EDIT:
Hey there Smile
So, I made that when you interact with a statue, something will happen.
But in-game the "hand" picture appears in every part of the statue, but I only want to interact with the head.
So when the player interacts with the head, that something will happen.
How can I do that?

P.S.: The statue I'm talking about is the Knight one

Check it out!
http://www.youtube.com/Nervly

Please?
[Image: please-please-please.jpg]
(This post was last modified: 07-06-2012, 10:26 AM by Nervly.)
07-04-2012, 12:35 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#65
RE: 3 Questions: Cave In and Destroying bookshelf

I myself haven't found a good way, but here is 1 that is..acceptable:
place the full armor somewhere, and place a head(a single head) inside the head of the full armor, but in such a way that it looks like 1.
tick Static physics at both the head and the complete.
then, use this:

inside OnStart or where ever you want:

SetEntityPlayerInteractCallback("armour_nice_head_1", "DoSomeRandom", true);

void DoSomeRandom(string &in asEntity)
{
SetPropStaticPhysics("armour_nice_head_1", false);
SetEntityActive("armour_nice_head_1", false);
SetPropStaticPhysics("armour_nice_complete_1", false);
AddPropForce("armour_nice_complete_1", 0, 100, 200, "world");
}

This basically only allows the pick up for the head, which becomes non-static and removed, the armor becomes non-static and you add some small prop force so the head pops out and on the ground(without that pop out effect, it just doesn't look right.)
The stuff to happen will get inside that function, too.

Of course there are other ways:

Another way would be to place 4 script areas around the head of the complete armor, and use a Entity Collide Callback to happen when the complete suit touches any script area. A bit tricky to do, but it might work better than the above example(what ever fits you more).

Maybe there is another way to alter the user variables of the complete armor in the model editor, or altering the armor some other way in the model editor. No idea on that though.

Think, before you speak Google, before you post
07-06-2012, 11:22 AM
Find
Nervly Offline
Junior Member

Posts: 40
Threads: 2
Joined: Feb 2012
Reputation: 0
#66
RE: 3 Questions: Cave In and Destroying bookshelf

Spoiler below!
(07-06-2012, 11:22 AM)FastHunteR Wrote: I myself haven't found a good way, but here is 1 that is..acceptable:
place the full armor somewhere, and place a head(a single head) inside the head of the full armor, but in such a way that it looks like 1.
tick Static physics at both the head and the complete.
then, use this:

inside OnStart or where ever you want:

SetEntityPlayerInteractCallback("armour_nice_head_1", "DoSomeRandom", true);

void DoSomeRandom(string &in asEntity)
{
SetPropStaticPhysics("armour_nice_head_1", false);
SetEntityActive("armour_nice_head_1", false);
SetPropStaticPhysics("armour_nice_complete_1", false);
AddPropForce("armour_nice_complete_1", 0, 100, 200, "world");
}

This basically only allows the pick up for the head, which becomes non-static and removed, the armor becomes non-static and you add some small prop force so the head pops out and on the ground(without that pop out effect, it just doesn't look right.)
The stuff to happen will get inside that function, too.

Of course there are other ways:

Another way would be to place 4 script areas around the head of the complete armor, and use a Entity Collide Callback to happen when the complete suit touches any script area. A bit tricky to do, but it might work better than the above example(what ever fits you more).

Maybe there is another way to alter the user variables of the complete armor in the model editor, or altering the armor some other way in the model editor. No idea on that though.


Hmm, didn't though on the 2nd one.
But I used the 1st, and it works like I wanted Smile
I really want to thank you for all your help along the dev of my custom story.
Without it, I wouldn't be able to make it. Thanks a bunch ^^
You will be without any doubt in the credits.

+1 Rep Wink

Check it out!
http://www.youtube.com/Nervly

Please?
[Image: please-please-please.jpg]
(This post was last modified: 07-09-2012, 09:49 AM by Nervly.)
07-06-2012, 12:18 PM
Find
Nervly Offline
Junior Member

Posts: 40
Threads: 2
Joined: Feb 2012
Reputation: 0
#67
RE: 3 Questions: Cave In and Destroying bookshelf

Hello again Cruzore/FastHunteR or new helper Tongue
Well, my new question is, how do I create a door?
Like, I want to make a mirror a door, so I went to the ModelEditor, opened a door file, and replaced the door with a mirror, and that colored boxes are still there and joints, etc.
But when I go on the LevelEditor and place the Mirror Door, ingame the hand doesn't show up, so I cant open it. :/
How do I make the mirror a door?

Check it out!
http://www.youtube.com/Nervly

Please?
[Image: please-please-please.jpg]
09-13-2012, 05:13 PM
Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#68
RE: 3 Questions: Cave In and Destroying bookshelf

Open your model in the ModelEditor, go to "User Defined Variables" in Settings (I think), and there should be a drop-down arrow at the top of the new window. Look through there, and use "SwingDoor".

That should work.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
09-13-2012, 06:42 PM
Website Find
Nervly Offline
Junior Member

Posts: 40
Threads: 2
Joined: Feb 2012
Reputation: 0
#69
RE: 3 Questions: Cave In and Destroying bookshelf

(09-13-2012, 06:42 PM)Nemet Robert Wrote: Open your model in the ModelEditor, go to "User Defined Variables" in Settings (I think), and there should be a drop-down arrow at the top of the new window. Look through there, and use "SwingDoor".

That should work.
Sorry, I forgot to mention I did that Confused
It didn't work tho, the hand didn't appear :/
Thanks for the answer ^^

Check it out!
http://www.youtube.com/Nervly

Please?
[Image: please-please-please.jpg]
09-14-2012, 01:02 AM
Find
Nervly Offline
Junior Member

Posts: 40
Threads: 2
Joined: Feb 2012
Reputation: 0
#70
RE: 3 Questions: Cave In and Destroying bookshelf

Hello again Cruzore/FastHunteR or new helper [Image: tongue.gif]
Well, my new question is, how do I create a door?
Like, I want to make a mirror a door, so I went to the ModelEditor, opened a door file, and replaced the door with a mirror, and that colored boxes are still there and joints, etc.
But when I go on the LevelEditor and place the Mirror Door, ingame the hand doesn't show up, so I cant open it. :/
How do I make the mirror a door?

Quote:" Open your model in the ModelEditor, go to "User Defined Variables" in Settings (I think), and there should be a drop-down arrow at the top of the new window. Look through there, and use "SwingDoor". "
I did that too, but it didn't work.

Thanks for taking your time to help me Smile


*bump*

Check it out!
http://www.youtube.com/Nervly

Please?
[Image: please-please-please.jpg]
09-21-2012, 07:32 PM
Find




Users browsing this thread: 1 Guest(s)