func_door_rotating

Post anything to do with editing Nexuiz here. Whether its problems you've had, questions, or if you just want to show off your work.

Moderators: Nexuiz Moderators, Moderators

func_door_rotating

Postby RoKenn » Fri Dec 26, 2008 11:54 pm

I made a patch that implements rotating doors (doors which open like "normal" doors, as opposed to sliding doors).

If you are interested in it, please try it and give me feedback.

You can download the patch and 2 really stupid demo maps from:

http://rear.endoftheinternet.org/~blub/ ... 0b3e814dfd

Unzip it, apply the diff to your svn checkout and copy the pk3 into your ...nexuiz/data directory.

You can also view the code at: http://pastebin.com/m778469b3

Then run:

nexuiz +map rodoor # a very simple map with a pair of linked rotating doors

nexuiz +map viteamea_ro # a variant of vitamea_v2 which contains rotating doors around the red base

Note:

A feature that is not implemented yet are "bidirectional" doors, which open away from the triggering person (suggested by Ronan). That's on my todo list.
[Tue Aug 5 2008] [00:15:01] <Ronan`> RoKenn, you're an evil person :P
Image
RoKenn
Alien
 
Posts: 141
Joined: Wed Apr 25, 2007 10:25 pm

Postby Ronan » Sat Dec 27, 2008 12:28 am

The patch is working fine for me using the test maps, nice works RoKenn. :)

To apply the patch, put rodoor_v1.patch in your Nexuiz svn checkout then :
Code: Select all
cd Nexuiz/
patch -p0 <rodoor_v1.patch

To remove it :
Code: Select all
patch -R -p0 <rodoor_v1.patch


How it look like in NetRadiant :
Image

Image

Don't forger to copy the entities.def files from Nexuiz/data/scripts/
to NetRadiant/nexuiz.game/data/ if you want to see func_door_rotating in the menus.
Also move from your dlcache/ to data/ vitamea-v2.pk3 and above all augenkrebs_alpha6.pk3 to enjoys the wonderful textures. :P
Ronan
Alien trapper
 
Posts: 292
Joined: Tue Mar 20, 2007 10:25 pm
Location: France

Postby PinkRobot » Sat Dec 27, 2008 8:40 am

Yay this is great! Thanks a lot for implementing this.
Now with new shiny avatar.
PinkRobot
Alien trapper
 
Posts: 443
Joined: Fri Jul 21, 2006 7:06 pm
Location: #brlogetc

Postby divVerent » Sat Dec 27, 2008 2:45 pm

Patch looks good and harmless (as it changes nothing if no rotating doors are used). Great.

Committed. Will test later.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby RoKenn » Sat Dec 27, 2008 3:26 pm

Actually it affects func_door slightly (some more mins/absmin replacements, and a branch between func_door and func_door_rotating). But that shouldn't contain any bugs.

PunkRabbit, you could do me a favor and try it. If you want anything in the interface changed, it's not too late. Once it is used in some maps, there won't be a chance anymore.

Implementing the bidirectional stuff will probably take some time (for learning mostly).
Maybe that will affect func_door as well, if I saw it correctly the trigger field is very static currently, and extends to the sides of the door as well. (That means, if someone moves in a room next to the door, it could slide open.)

* walks off to dive into the code for trigger fields *
[Tue Aug 5 2008] [00:15:01] <Ronan`> RoKenn, you're an evil person :P
Image
RoKenn
Alien
 
Posts: 141
Joined: Wed Apr 25, 2007 10:25 pm

Postby divVerent » Sat Dec 27, 2008 3:33 pm

The doors on vitamea_ro feel somewhat weird, sometimes they're open and close when I get near, sometimes the other way round. Any idea why?
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby RoKenn » Sat Dec 27, 2008 3:36 pm

divVerent wrote:The doors on vitamea_ro feel somewhat weird, sometimes they're open and close when I get near, sometimes the other way round. Any idea why?


Yes. :)

One is a "start open" door. (The one on the left exit of the base)

The next one is a "toggle" door.

I experimented with different types of doors, to get rid of the bugs.

The huge blue ones are linked doors. And on the right side is a "garage door", to try x-axis for rotation.
[Tue Aug 5 2008] [00:15:01] <Ronan`> RoKenn, you're an evil person :P
Image
RoKenn
Alien
 
Posts: 141
Joined: Wed Apr 25, 2007 10:25 pm

Postby PinkRobot » Tue Dec 30, 2008 3:35 pm

I finally got round to trying this in a test map today and it works as I hoped it would. I don't have any suggestions for the time being. The information in the entities.def is sufficient and i have not seen any bugs with the doors yet. Of course I will try some more stuff. For example, I know of a certain microwave that could do with a func_door_rotating ;P

Nice work.
Now with new shiny avatar.
PinkRobot
Alien trapper
 
Posts: 443
Joined: Fri Jul 21, 2006 7:06 pm
Location: #brlogetc

Postby RoKenn » Tue Dec 30, 2008 10:45 pm

Thanks, PunkRabbit!

Well, bidirectional was easier than I thought. It's basically working, there are just a few issues:

I'm using 2 trigger_multiple for triggering it (one must have targetname set to "trigger_reverse"). That could increase the server load a bit, because it triggers permanently if someone is standing on it. But it probably is required to keep the door open, while someone is standing on it.

I'm abusing self.lip to remember that the angle is inverted, because it's unused otherwise. Is there a better variable?

And: I shifted the BIDIR spawnflag to one of the unused lower positions. I assume they were just unused for historical reasons.

PS: I hate to agree with Ronan :P, but it makes sense most of the time. If the door opens towards you it obstructs the movement, and that can be quite annoying.
[Tue Aug 5 2008] [00:15:01] <Ronan`> RoKenn, you're an evil person :P
Image
RoKenn
Alien
 
Posts: 141
Joined: Wed Apr 25, 2007 10:25 pm

Postby RoKenn » Wed Dec 31, 2008 1:17 pm

OMG, that is a small patch finally. :? But bidirectional doors work now.

How to use it: if you set the bidir spawn flag, you must manually instantiate triggers (trigger_multiple). The one which is supposed to open in the reverse direction must have set targetname to trigger_reverse.


The demo map has two bidirectional doors: If you exit the base through the middle left exit, you will find a double-door, and if you exit through the right rotating door, the first one after the garage door is also bidirectional.

You can download it - including the stupid demo map - from:

http://rear.endoftheinternet.org/~blub/nexfiles/?page=file&file=c56bb3dbc8f5e2043a08bf44f73a5186

Or view the diff at:

http://paste.debian.net/24850/
[Tue Aug 5 2008] [00:15:01] <Ronan`> RoKenn, you're an evil person :P
Image
RoKenn
Alien
 
Posts: 141
Joined: Wed Apr 25, 2007 10:25 pm

Next

Return to Nexuiz - Editing

Who is online

Users browsing this forum: No registered users and 1 guest

cron