Back to the Korax Forum Archives
RambOrc
Crimson Wizard
RambOrc
RambOrc
Firebrand
RambOrc
Crimson Wizard
By default, the polyobj rotates in a counter-clockwise direction. Using this function in ACS, you can reverse that direction by supplying a negative value to the speed parameter.This means you should use script to do this. Also, you may use Polyobj_RotateLeft/Right commands. HINT: to save script numbers you may use generic script with some parameters passed in, for example:
// script 100 swings doors clockwise by 60 angle points // script 100 (int polyId, int speed, int delay) { Polyobj_DoorSwing(polyId, -speed, 60, delay); }Then you should use ACS_Execute action special on polyobject lines instead of DoorSwing, with corresponding parameters (script id, map id - this may be 0, polyobject id, speed, delay). [quote="Firebrand":ztqh2e9i] IIRC it was the polyobject anchor's thing angles, depending the angles they have, it's how much the polyobject will rotate. Polyobject anchor and start things use their angle to store polyobject ID. [quote="RambOrc":ztqh2e9i]I want to save on the number of polyobjects and doors that are opening in the same direction and aren't in line of sight of each other can be used with the same polyobj angle, but if they are all heard, the sound might sound weird. You cannot use same polyobj in two or more different locations at once, placing 2 or more polyobj starts for same polyobj ID crashes the game. Polyobject is not a 3dfloor template, every one is unique.
RambOrc
// script 100 swings doors clockwise by 60 angle points (?) // script 100 (int polyId, int speed, 60, int delay) { Polyobj_DoorSwing(polyId, -speed, 60, delay); }Then you should use ACS_Execute action special on polyobject lines instead of DoorSwing, with corresponding parameters (script id, map id - this may be 0, polyobject id, speed, delay). Is there any difference in load speed of a map and/or frame rates if a map has a large number of scripts? [quote="CW":2971ea1s] Polyobject anchor and start things use their angle to store polyobject ID. Yep, that was one of the few things I understood right from the ZDOOM tutorial before starting this thread. They used angles for polyobject identification before the tag system for things was implemented. [quote="CW":2971ea1s]You cannot use same polyobj in two or more different locations at once, placing 2 or more polyobj starts for same polyobj ID crashes the game. Polyobject is not a 3dfloor template, every one is unique. Not so bad, I can just copy+paste the polyobj sectors then, though it would have been quicker to add lots of doors with my idea.
Crimson Wizard
Firebrand
Crimson Wizard
Firebrand
Crimson Wizard
RambOrc
Crimson Wizard
// script 100 swings doors clockwise by 60 angle points // script 100 (int polyId, int speed, int delay) { Polyobj_DoorSwing(polyId, -speed, 60, delay); }Then you should use ACS_Execute action special on polyobject lines, with corresponding parameters (script id, map id - this may be 0, polyobject id, speed, delay). Positive speed parameter will rotate polyobj in one direction, negative - in different. I don't remember which is which but it is easy to find out. Also, I don't remember how much degrees one "angle point" holds. I think 60 angle points is approximately 90 degrees, or so.
RambOrc
Crimson Wizard
Crimson Wizard
// script 100 swings doors clockwise; destination is North (64) // script 100 (int polyId, int speed, int _delay) { Polyobj_DoorSwing(polyId, -speed, 64, _delay); }(NOTE: '_delay' param has the '_' to make compiler distinguish it from 'delay' script command) The purpose of this script is to send negative value; you cannot define negative value in linedef arguments (as you mentioned above). You do not need to use similar script for counter-clockwise rotation, but if you want to, or need this for some reason, script should be different:
Polyobj_DoorSwing(polyId, speed, angle, delay);That is - speed should be without 'minus' sign. On my Map02 first (southern) doors have simply Polyobj_DoorSwing applied, and second (northern) doors call the script which make them rotate different way. 2. (see map03) Polyobj_RotateLeft/Right. If you have 2-leaf door you may make one of the leafs be a mirror, but also you may make them rotate individually (e.g. use RotateLeft on first and RotateRight on second) but that's more complicated. However, these actions do not make polyobjs return back to their original positions; so if you need doors close automatically, then you'll have to use script, like that:
script 100 (int polyobj, int speed, int _delay) { Polyobj_RotateLeft(polyobj, speed, 64); delay(_delay); Polyobj_RotateRight(polyobj, speed, 64); }On my map 1st doors (southern) are opened forever using RotateLeft, second doors open forever using RotateRight and last doors (northern) are opened and closed by script. By they way, there's interesting thing, I am not completely sure but it seems that when you use RotateRight actual destination angle is opposite to what you type there. I typed 64 (North) but doors opened to South.
Firebrand
Crimson Wizard
Firebrand
RambOrc
Crimson Wizard
RambOrc
Firebrand