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


Thread Rating:
  • 4 Vote(s) - 3.75 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting n00b in need of help.
Cellrage Offline
Junior Member

Posts: 4
Threads: 0
Joined: Oct 2010
Reputation: 0
#21
RE: Scripting n00b in need of help.

I'm going to assume that you have it set so that when you pick up the lantern, it runs "lanterndooractivate".

First thing that you should probably get in the habit of is to add debug messages to whatever functions you're having trouble with so you can visually see if they are being called or not.

On to your script, I can see a few potential problems. One is that the disable auto close should be probably called at the same time as the prop force, as I'm pretty sure the disable auto close isn't permanent.

The second is your actual prop force. The three number inputs stand for x, y, and z, in that order I think. You don't need an impulse in every axis to open the door, only in either the z or the x axis. Check in your level editor to see which direction you should push it, or just experiment with slightly larger values.

Also, I tend to find AddPropImpulse works better for me.
11-14-2010, 03:08 AM
Find
Akumasama Offline
Member

Posts: 122
Threads: 2
Joined: Nov 2010
Reputation: 0
#22
RE: Scripting n00b in need of help.

I've tried all that.
The door should be pushed through the X-axis.
Also tried moving the auto close command, without success.
11-14-2010, 03:19 AM
Find
Chilton Offline
Member

Posts: 138
Threads: 9
Joined: Sep 2010
Reputation: 0
#23
RE: Scripting n00b in need of help.

Bumping doors isnt simple - Try using about 300 X axis force, and failing that, post the script in here and i (or some ninja :p) will post a "repaired" version if they can
(This post was last modified: 11-14-2010, 03:33 AM by Chilton.)
11-14-2010, 03:33 AM
Find
Akumasama Offline
Member

Posts: 122
Threads: 2
Joined: Nov 2010
Reputation: 0
#24
RE: Scripting n00b in need of help.

(11-14-2010, 03:33 AM)Chilton Wrote: Bumping doors isnt simple - Try using about 300 X axis force, and failing that, post the script in here and i (or some ninja :p) will post a "repaired" version if they can

300? O.o

I'll try that first thing in the morning.
11-14-2010, 03:37 AM
Find
Cellrage Offline
Junior Member

Posts: 4
Threads: 0
Joined: Oct 2010
Reputation: 0
#25
RE: Scripting n00b in need of help.

Also, add a debug message in the lanterndooractivate function.
Check to see if it's actually calling the function when you pick up that lantern.

If all else fails, post the script like Chilton said, or upload your map so someone can look over it.
11-14-2010, 03:37 AM
Find
Akumasama Offline
Member

Posts: 122
Threads: 2
Joined: Nov 2010
Reputation: 0
#26
RE: Scripting n00b in need of help.

Well, I can't get it to work.
The function doesn't get activated it seems, but the door does unlock for some reason.

http://www.mediafire.com/?cb89o48ssez97o9

This is the custom story folder...

Please point out all the stuff I did wrong while your at it, if you please ;D
11-15-2010, 04:49 PM
Find
Akumasama Offline
Member

Posts: 122
Threads: 2
Joined: Nov 2010
Reputation: 0
#27
RE: Scripting n00b in need of help.

So I've just checked the maps from the official story.
They showed me this code.

SetSwingDoorLocked("Door_3", false, false);
    SetSwingDoorClosed("Door_3", false, false);
    SetSwingDoorDisableAutoClose("Door_3", true);

Nothing interesting below or above it.
It was triggered with a timer.

So then I just copy paste the code and modified it so it uses the names I use.
No luck.

Then I entered a debug message, saying "Message".
The message showed up, so it does trigger the actual code, but nothing happens with the door :/
11-15-2010, 08:59 PM
Find
Akumasama Offline
Member

Posts: 122
Threads: 2
Joined: Nov 2010
Reputation: 0
#28
RE: Scripting n00b in need of help.

Sorry for the triple post everyone.

My problem has been resolved.
I think I made a typo somewhere in the AddPropImpulse code...

Oh well, I shall post here again should I need more help.
11-16-2010, 11:23 PM
Find
Frontcannon Offline
Senior Member

Posts: 538
Threads: 10
Joined: Jul 2010
Reputation: 2
#29
RE: Scripting n00b in need of help.

(11-16-2010, 11:23 PM)Akumasama Wrote: I think I made a typo somewhere in the AddPropImpulse code...

Unlikely, wouldn't that screw up the syntax 90% of the time?


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
11-16-2010, 11:36 PM
Find
Akumasama Offline
Member

Posts: 122
Threads: 2
Joined: Nov 2010
Reputation: 0
#30
RE: Scripting n00b in need of help.

Yeah, I geuss it would screw it up...

But I'm not entirely sure what I did wrong then xP
Oh well, it's going pretty good at the moment.
I've added a timer without problems, and playing sounds.
So yeah... I'll post again should I have more problems.
11-18-2010, 10:28 AM
Find




Users browsing this thread: 1 Guest(s)