Back to the Korax Forum Archives


Forum

polyobj doors

Sat, 31 Jan 2009 22:09:08

RambOrc

OK I give up, I spent about 2 hours on this, using ZDOOM tutorials and sample maps, I couldn't get anything to work. I haven't been able to find any Vavoom tutorials, so can somebody who knows how to make a small demo map with nothing but a door opening at 90°?
Mon, 02 Feb 2009 13:09:09

Crimson Wizard

I made both types of doors just in case. MAP01 demonstrates sliding door, MAP02 - swinging (rotating) door. There could be some other ways to make these, like using polyobj_move/rotate commands in script. <!-- m --><a class="postlink" href="http://downloads.orcishweb.com/koraxdev/koraxrpg/polyobj.wad">http://downloads.orcishweb.com/koraxdev ... olyobj.wad</a><!-- m -->
Mon, 02 Feb 2009 17:24:26

RambOrc

Thanks, finally a working example map. <!-- s;) --><img src="{SMILIES_PATH}/orc9.gif" alt=";)" title="Wink" /><!-- s;) -->
Mon, 02 Feb 2009 22:37:02

RambOrc

One thing I didn't quite see, how do I build the polyobj sector easily? I did a couple of false tries and then ended up copying your polyobj sector into the city map. Also, which value determines the direction into which the door swings?
Mon, 02 Feb 2009 23:07:45

Firebrand

IIRC it was the polyobject anchor's thing angles, depending the angles they have, it's how much the polyobject will rotate.
Tue, 03 Feb 2009 11:20:05

RambOrc

I changed the angle in the linedef polyobject swing definition to a smaller one and it worked as expected, the door didn't open quite fully, just a tad. I changed the angle to a larger number and the door still opened in the same direction, just even more widely. Another question, how far away can the player hear the sound if a door is opened? I ask because 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.
Tue, 03 Feb 2009 12:03:27

Crimson Wizard

First of all, here's an article from Zdoom wiki: <!-- m --><a class="postlink" href="http://zdoom.org/wiki/Polyobject">http://zdoom.org/wiki/Polyobject</a><!-- m --> In fact it is exactly the sample I built myself (although I did not use it). [quote="RambOrc":ztqh2e9i]One thing I didn't quite see, how do I build the polyobj sector easily? Polyobject is not a sector, it's rather sequence of solid 1-side lines. It is created same way as you create solid columns inside sector. You create dummy sector of any size anywhere on map, then create a sub-sector of the size and shape you need polyobject be inside that dummy sector, then delete that subsector. [quote="RambOrc":ztqh2e9i]Also, which value determines the direction into which the door swings? Zdoom wiki: <!-- m --><a class="postlink" href="http://zdoom.org/wiki/Polyobj_DoorSwing">http://zdoom.org/wiki/Polyobj_DoorSwing</a><!-- m -->
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.
Tue, 03 Feb 2009 14:57:10

RambOrc

[quote="Crimson Wizard":2971ea1s]First of all, here's an article from Zdoom wiki: <!-- m --><a class="postlink" href="http://zdoom.org/wiki/Polyobject">http://zdoom.org/wiki/Polyobject</a><!-- m --> In fact it is exactly the sample I built myself (although I did not use it). That's the tutorial I was using and couldn't get to work so don't link it. <!-- s:P --><img src="{SMILIES_PATH}/orc4.gif" alt=":P" title="Razz" /><!-- s:P --> [quote="Crimson Wizard":2971ea1s] Polyobject is not a sector, it's rather sequence of solid 1-side lines. It is created same way as you create solid columns inside sector. You create dummy sector of any size anywhere on map, then create a sub-sector of the size and shape you need polyobject be inside that dummy sector, then delete that subsector. I figured that much, but how exactly do I delete the dummy sector? If I highlight the subsector, it deletes it along with the linedefs. [quote="CW":2971ea1s]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, 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.
Tue, 03 Feb 2009 15:18:17

Crimson Wizard

[quote="RambOrc":1liskqvc] [quote="Crimson Wizard":1liskqvc] Polyobject is not a sector, it's rather sequence of solid 1-side lines. It is created same way as you create solid columns inside sector. You create dummy sector of any size anywhere on map, then create a sub-sector of the size and shape you need polyobject be inside that dummy sector, then delete that subsector. I figured that much, but how exactly do I delete the dummy sector? If I highlight the subsector, it deletes it along with the linedefs. Hmm, that's how WadAuthor works, perhaps? Might be it uses some other technique to make "columns", maybe you should check WadAuthor manual; it's been too long since I used it last time so I do not remember. EDIT: Aha, I found it, when you create new sector you should check "Column" checkbox. You shouldn't delete it afterwards, ofcourse. [quote="RambOrc":1liskqvc] Is there any difference in load speed of a map and/or frame rates if a map has a large number of scripts? Should not be any, I am just afraid that number of scripts is limited. Original Hexen had limit of 255 scripts. By the way, there was a mistake in script sample, I fixed it now in my previous post. [quote="RambOrc":1liskqvc] 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. By the way, you can have any number of polyobjects in same dummy sector; that is, in theory you may create some huge sector somewhere aside main map area, and put all polyobjects there. Not sure if it will affect perfomance somehow, though.
Tue, 03 Feb 2009 17:46:49

Firebrand

It shouldn't affect performance, only if a very large number of polyobjects is activated (think about 50 or 60 polyobjects at the same time), but I don't think that would be the case for KRPG <!-- s:) --><img src="{SMILIES_PATH}/orc2.gif" alt=":)" title="Smile" /><!-- s:) -->.
Tue, 03 Feb 2009 17:48:18

Crimson Wizard

[quote="Firebrand":nzznnqb8]It shouldn't affect performance, only if a very large number of polyobjects is activated (think about 50 or 60 polyobjects at the same time), but I don't think that would be the case for KRPG <!-- s:) --><img src="{SMILIES_PATH}/orc2.gif" alt=":)" title="Smile" /><!-- s:) -->. I did not mean polyobject count, I meant huge dummy sector itself.
Tue, 03 Feb 2009 17:57:47

Firebrand

The same applies to dummy sectors, only if you activate a huge number of them the game will have a small impact on performance <!-- s:) --><img src="{SMILIES_PATH}/orc2.gif" alt=":)" title="Smile" /><!-- s:) -->.
Tue, 03 Feb 2009 18:05:03

Crimson Wizard

[quote="Firebrand":37lt9nxk]The same applies to dummy sectors, only if you activate a huge number of them the game will have a small impact on performance <!-- s:) --><img src="{SMILIES_PATH}/orc2.gif" alt=":)" title="Smile" /><!-- s:) -->. I am not talking about any activation, I am talking about huge dummy sector on the map, which is kept in memory, updated and rendered over time.
Sat, 04 Jul 2009 18:09:52

RambOrc

Next question, looks like doors swing clockwise, how do I make a door that swings counterclockwise? Is it only possible if I set up an extra dummy door that is swinging clockwise and then specify my real door to mirror it?
Sat, 04 Jul 2009 18:38:26

Crimson Wizard

[quote="RambOrc":37b70ki4]Next question, looks like doors swing clockwise, how do I make a door that swings counterclockwise? Is it only possible if I set up an extra dummy door that is swinging clockwise and then specify my real door to mirror it? Hehe, actaually I wrote about this in this thread half o' the year ago <!-- s:D --><img src="{SMILIES_PATH}/orc6.gif" alt=":D" title="Very Happy" /><!-- s:D --> What is confusing me, ZDoom wiki states that default direction is counter-clockwise, not clockwise. Anyway, solution depends on what method you use to make polyobject move. You can use such commands as Polyobject_RotateLeft/Right. Also you may use similar script:
// 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.
Sat, 04 Jul 2009 18:58:24

RambOrc

You can use negative values in a script that the wad editor would not accept for the object? Also, if I add -60 in raw edit mode for the linedef, it is converted to 196 which puts the door after opening in the right position, but turns to there the wrong way.
Sat, 04 Jul 2009 19:04:57

Crimson Wizard

Alright, give me a while I'll check all that myself and try to make new examples. <!-- s:) --><img src="{SMILIES_PATH}/orc2.gif" alt=":)" title="Smile" /><!-- s:) -->
Sat, 04 Jul 2009 20:30:08

Crimson Wizard

First of all, explanation of angle points: <!-- m --><a class="postlink" href="http://zdoom.org/wiki/Definitions#Byte_Angles">http://zdoom.org/wiki/Definitions#Byte_Angles</a><!-- m --> Basically, you define not the AMOUNT of rotation but the destination angle. 96 - Northwest 64 - North 32 - Northeast 128 - West 0 - East 160 - Southwest 192 - South 224 - Southeast. Then, I upoaded an updated polyobj.wad to server: <!-- m --><a class="postlink" href="http://downloads.orcishweb.com/koraxdev/ScatteredEvil/maps/polyobj.wad">http://downloads.orcishweb.com/koraxdev ... olyobj.wad</a><!-- m --> There are 2 ways to make a rotating doors. 1. (see map02) Polyobj_DoorSwing. If you are making 2-leaf doors this requires making one polyobject a mirror of another. To make lead (or sole) door open counter-clockwise simply apply this command as an action special to polyobj line (mirrored door will open clockwise ofc). To make lead (or sole) door open clockwise you will have to use that script.
// 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.
Sun, 05 Jul 2009 03:20:54

Firebrand

I wonder... couldn't we use prefabs for this? DoomBuilder allows to create architecture and save it as prefabs, that can be used and adjusted as needed when doing maps. I remember that we discussed this time ago when Mago began doing test architecture on doombuilder, I always thought it was a good idea to do these kind of things for the project, which will speed up the process of mapping large areas a bit.
Sun, 05 Jul 2009 13:25:09

Crimson Wizard

RambOrc is using WadAuthor <!-- s:P --><img src="{SMILIES_PATH}/orc4.gif" alt=":P" title="Razz" /><!-- s:P -->
Sun, 05 Jul 2009 15:28:59

Firebrand

There is always a reason for improvement, heh! <!-- s:P --><img src="{SMILIES_PATH}/orc4.gif" alt=":P" title="Razz" /><!-- s:P -->
Sun, 05 Jul 2009 18:07:09

RambOrc

I also have Doombuilder 2, but having trouble with textures not showing in view mode.
Sun, 05 Jul 2009 21:45:23

Crimson Wizard

I decided to try DB2... Did anyone tried making config files for that? I made an attempt, finally it shows no mistakes when loads configurations, but every time I do something with KA config, like setting options for it or creating new map, an error window pops up, telling something about System::String and IDictionary or something. As for new editor, it is really good, allowing drawing sectors freely over existing sectors; that should greatly easen work with 3dfloors making.
Sun, 05 Jul 2009 22:57:17

RambOrc

I'm not averse to working with DB2 if it can handle KRPG maps.
Mon, 06 Jul 2009 12:47:54

Firebrand

I was thinking on doing a config file for KA, but I haven't had time to sit down and work on it <!-- s:( --><img src="{SMILIES_PATH}/orc10.gif" alt=":(" title="Sad" /><!-- s:( -->.

Back to the Korax Forum Archives