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
AddAttachedPropToProp problems
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#1
AddAttachedPropToProp problems

I've been trying to replicate the mechanics of the elevator switch in Machine for Pigs, but am having a small problem with one of the scripts. Here's what the switch script looks like so far:

PHP Code: (Select All)
void ElevatorDescent (string &in asEntityint alState)
{
    if (
alState == 1)
    {
        
AddAttachedPropToProp("elevator_pod_1""ElevatorSwitchStatic""elevator_switch_static.ent"0.06f, -1.842f, -0.068f0.0f0.0f0.0f);
        
PlaySoundAtEntity("""church_draw_lever_open.snt""ElevatorSwitchSource"0.0ffalse);
        
SetEntityActive("ElevatorSwitch"false);
        
SetMoveObjectState("elevator_door_right_1"0);
        
SetMoveObjectState("elevator_door_left_1"0);
        
PlaySoundAtEntity("""reactor_elevator_door_close_3D.snt""ElevatorDoorSource"0.0ffalse);
        
PlaySoundAtEntity("""reactor_elevator_door_close_2D.snt""ElevatorDoorSource"0.0ffalse);
        
AddTimer("ElevatorMoves"3.5f"ElevatorMoves");
    }


My problem is with the afPosZ portion of the AddAttachedPropToProp script, which in game seems to be permanently set as thought it were at 0. When I change the X and Y floats, it moves the static lever around, but changing the Z float doesn't move it at all. While it's like this, as soon as I pull the switch into position, the static switch just appears in the middle of the elevator panel, instead of in the slot like it's supposed to.

10-02-2013, 03:08 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: AddAttachedPropToProp problems

http://www.frictionalgames.com/forum/thr...#pid265735

Tutorials: From Noob to Pro
10-02-2013, 03:27 AM
Website Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#3
RE: AddAttachedPropToProp problems

To elaborate: afPosZ is ignored and afRotZ is used for both the z position and z rotation of the prop. The good news is that this has been fixed in the update with the introduction of AttachPropToProp (as well as another bug related to AddAttachedPropToProp).
10-02-2013, 04:00 AM
Find
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#4
RE: AddAttachedPropToProp problems

Ah, thank you kind sirs. Works fine with the patch.

(This post was last modified: 10-04-2013, 07:06 AM by Damascus.)
10-04-2013, 07:02 AM
Find




Users browsing this thread: 2 Guest(s)