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
sigh... a fatal error.. again!
Ouroboros Offline
Junior Member

Posts: 20
Threads: 0
Joined: Jul 2011
Reputation: 0
#11
RE: sigh... a fatal error.. again!

It would be more complicated for me to add it for you since I can't see and move things on your map. All you have to do is move the closet in the direction it opens, and see if the X or Z coordinate increases or decreases. If the X coordinate increases, use

AddBodyForce("metal_cabinet_1_rightDoor", 900, 0, 0, "world");
AddBodyForce("metal_cabinet_1_leftDoor", 900, 0, 0, "world");

And that will push the doors open. If the X coordinate decreases, add - in front of the 900. And if the Z coordinate changes, you do the same but it's in the third number section.

AddBodyForce("metal_cabinet_1_rightDoor", 0, 0, 900, "world");
AddBodyForce("metal_cabinet_1_leftDoor", 0, 0, 900, "world");

And then you just add the SetSwingDoorAutoCloseDisable("name", true);
And SetSwingDoorClosed("name", false, true); before the AddBodyForce code.
07-18-2011, 03:49 PM
Find
TheDavenia Offline
Member

Posts: 223
Threads: 38
Joined: Jun 2011
Reputation: 0
#12
RE: sigh... a fatal error.. again!

(07-18-2011, 03:49 PM)Ouroboros Wrote: It would be more complicated for me to add it for you since I can't see and move things on your map. All you have to do is move the closet in the direction it opens, and see if the X or Z coordinate increases or decreases. If the X coordinate increases, use

AddBodyForce("metal_cabinet_1_rightDoor", 900, 0, 0, "world");
AddBodyForce("metal_cabinet_1_leftDoor", 900, 0, 0, "world");

And that will push the doors open. If the X coordinate decreases, add - in front of the 900. And if the Z coordinate changes, you do the same but it's in the third number section.

AddBodyForce("metal_cabinet_1_rightDoor", 0, 0, 900, "world");
AddBodyForce("metal_cabinet_1_leftDoor", 0, 0, 900, "world");

And then you just add the SetSwingDoorAutoCloseDisable("name", true);
And SetSwingDoorClosed("name", false, true); before the AddBodyForce code.

How am i supposed to see if it opens in x or z or y Huh

Current Project: Nightmare's End(Project Director, Scripter, boss >:D)
07-18-2011, 05:16 PM
Find
Ouroboros Offline
Junior Member

Posts: 20
Threads: 0
Joined: Jul 2011
Reputation: 0
#13
RE: sigh... a fatal error.. again!

A cabinet will open in the direction the doors face. So, in the level editor select the cabinet you want to open and move the camera so that the side with the doors faces you. Then, move it toward you slightly and watch it's coordinates to see which one increases/decreases.
Afterward you just move it back or use Ctrl + Z.



.jpg   Capture.jpg (Size: 434.34 KB / Downloads: 128)
.jpg   Capture2.jpg (Size: 434.08 KB / Downloads: 126)
07-18-2011, 07:49 PM
Find
TheDavenia Offline
Member

Posts: 223
Threads: 38
Joined: Jun 2011
Reputation: 0
#14
RE: sigh... a fatal error.. again!

(07-18-2011, 07:49 PM)Ouroboros Wrote: A cabinet will open in the direction the doors face. So, in the level editor select the cabinet you want to open and move the camera so that the side with the doors faces you. Then, move it toward you slightly and watch it's coordinates to see which one increases/decreases.
Afterward you just move it back or use Ctrl + Z.

I tried it but it doesn't work?
When i unlock it it doesn't fly open?

Current Project: Nightmare's End(Project Director, Scripter, boss >:D)
07-18-2011, 09:44 PM
Find
Ouroboros Offline
Junior Member

Posts: 20
Threads: 0
Joined: Jul 2011
Reputation: 0
#15
RE: sigh... a fatal error.. again!

(07-18-2011, 09:44 PM)TheDavenia Wrote:
(07-18-2011, 07:49 PM)Ouroboros Wrote: A cabinet will open in the direction the doors face. So, in the level editor select the cabinet you want to open and move the camera so that the side with the doors faces you. Then, move it toward you slightly and watch it's coordinates to see which one increases/decreases.
Afterward you just move it back or use Ctrl + Z.

I tried it but it doesn't work?
When i unlock it it doesn't fly open?
When I was trying to figure out how to do it, I found a post by someone and they said to make a box and play with it, push it around and such. So, I suggest making a small box and playing with AddPropForce and try to learn how to move it the way you want, then play around more with the cabinet doors. If you can get the box to move where you want it too, AddBodyForce works the same way and you'd just need to add the body name (for metal cabinets add _leftDoor or _rightDoor at the end of the entity name in the code).

07-19-2011, 04:24 AM
Find
HiagHarlon Offline
Junior Member

Posts: 1
Threads: 0
Joined: Sep 2013
Reputation: 0
#16
RE: sigh... a fatal error.. again!

(07-18-2011, 02:40 PM)Roenlond Wrote: You need three columns for setswingdoorlocked, not just two. Add a true/false to each of them if you wish to use effects when it happens.

Hi I have a similar problem to the one you solved for another person, where he was trying to lock and unlock a cabinet door i am trying to simpley unlock a level door on my map with a key, can you please help i get the same error!

here is the code

void OnStart()
{
AddUseItemCallBack("", "Key_1", "Lev_1", "FUNCTION", true);
}

void OnEnter()
{
}

void OnLeave()
{
}

void FUNCTION("Key_1", "Lev_1")
{
SetLevelDoorLocked("Lev_1", false);
RemoveItem("Key_1");
}
09-10-2013, 01:39 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#17
RE: sigh... a fatal error.. again!

(09-10-2013, 01:39 PM)HiagHarlon Wrote:
(07-18-2011, 02:40 PM)Roenlond Wrote: You need three columns for setswingdoorlocked, not just two. Add a true/false to each of them if you wish to use effects when it happens.

Hi I have a similar problem to the one you solved for another person, where he was trying to lock and unlock a cabinet door i am trying to simpley unlock a level door on my map with a key, can you please help i get the same error!

here is the code

void OnStart()
{
AddUseItemCallBack("", "Key_1", "Lev_1", "FUNCTION", true);
}

void OnEnter()
{
}

void OnLeave()
{
}

void FUNCTION(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("Lev_1", false);
RemoveItem("Key_1");
}

You had the wrong callback syntax. The [void FUNCTION(string &in asItem, string &in asEntity)] part was wrong.

The text in the bolded sentence is the callback syntax.

"Veni, vidi, vici."
"I came, I saw, I conquered."
09-10-2013, 03:22 PM
Find




Users browsing this thread: 3 Guest(s)