DF-21 Forums Forum Index DF-21 Forums
The Dark Forces Community
 
DF-21.net Home | FAQ | Search | Memberlist  | Register 
Profile | Log in to check your private messages | Log in

The "set_bits" command

 
Post new topic   Reply to topic    DF-21 Forums Forum Index -> Dark Forces Levels & Editing
View previous topic :: View next topic  
Author Message
Geoffrey S
Gamorrean

Joined: 29 Jan 2005

PostPosted: Mar 17, 2005 17:06    Post subject: The "set_bits" command View user's profile Send private message Reply with quote

I'm trying to make a forcefield using this command.

Quote:
message: 1 pad1(0) set_bits ?



What would I have to replace the question mark with if I want to prevent the player from moving through the wall, firing through the wall, and want to display a transparent texture?

Nottheking
Kell Dragon

Joined: 29 Sep 2003

PostPosted: Mar 18, 2005 18:35    Post subject: Re: The "set_bits" command View user's profile Send private message Reply with quote

Geoffrey S wrote:
I'm trying to make a forcefield using this command.

Code:
message: 1 pad1(0) set_bits ?


What would I have to replace the question mark with if I want to prevent the player from moving through the wall, firing through the wall, and want to display a transparent texture?


You'd need a seperate command for each of those flags you want changed. For the question mark, you'll want two numbers, seperated by a space. The first number, from 1-3, will determine which flag is to be changed. (flag 1 being the most commonly used flag, flag 2 being for port-ins from Doom only, and flag three noting the cross-ability parameters)

The next number is the specific bits you want to be set, or cleared. (if you're using clear_bits)Since flags are sets of binary digits, the value of the bits can be changed so that a single number can handle ANY and ALL of the bits of that flag at once.

In this case, if you want the adjoined wall section between two sectors to have a texture there, (the texture ITSELF will have the data on whether it is transparent or not) you'll want flag 1, bit 1.

For the third flag, This depends on whether you want to prevent enemies as well to walk through the wall. Since this is a "forcefield," I suppose you do. In this case, all are handled through flag three. On that flag, bit 2 stops the player from moving through the wall, bit 4 stops the enemies from walking through the wall, and bit 8 stops shots (fired by either the player or enemies) from going through the wall. Note that all of these blocks are assumed to be in effect at any non-adjoined section, of course. Since these are all binary bits, the numbers can be added together to make a unique combination: set bits 3 14 (2+4+8) will set bits 2, 4, and 8 on flag 3.

In essence, the actual commands you want in your INF are:
Code:
message: 1 pad1(0) set_bits 1 1
message: 1 pad1(0) set_bits 3 14

This changes a little if you also want the forcefield to reflect shots. Since the "magnetically sealed" flag is a sector flag, that means you'll have to set the whole sector to have that property. The command would be this:
Code:
message: 1 pad1 set_bits 1 4
I hope that was helpful.

_________________
Wake up, George Lucas... The Matrix has you..

The MAZZTer
Death Star
Death Star

Joined: 25 Sep 2003

PostPosted: Mar 19, 2005 14:58    Post subject: View user's profile Send private message Send e-mail Reply with quote

To best use the mag sealed (reflect bullets) property, make a sector of which one side is the force field, and the two other sides are adjoined to other sector(s). The idea is that this makes only the force field surface mag sealed. If you were to set the existing sector, there would be a few unadjoined surfaces for walls which would inherit the mag sealed property, which would be odd. Smile

If the player can be on both sides of the force field you will have to do this for both sides.

_________________
http://www.mzzt.net/ | I am a respectable admin with a respectable sig.

Geoffrey S
Gamorrean

Joined: 29 Jan 2005

PostPosted: Mar 19, 2005 19:05    Post subject: View user's profile Send private message Reply with quote

Cheers, it worked flawlessly.

Geoffrey S
Gamorrean

Joined: 29 Jan 2005

PostPosted: Mar 21, 2005 18:05    Post subject: View user's profile Send private message Reply with quote

Another minor problem with the same command.

Quote:
item: line name: closedoor2 num: 2
seq
class: trigger single
event_mask: 1
client: paddoor2
client: paddoordummy2
sound: 0
seqend

item: sector name: paddoordummy2
seq
class: elevator move_floor
speed: 0
sound: 1 0
sound: 2 0
sound: 3 0
stop: 0 hold
stop: 1 1
message: 1 closedoor2(0) set_bits 3 2
stop: 2 terminate
seqend



This all looks fine to me (clients correct and such), and is practically identical to some script earlier in the same level; however, the player is not prevented from moving through the wall but can still walk through the adjoin. Any ideas?

Nottheking
Kell Dragon

Joined: 29 Sep 2003

PostPosted: Mar 21, 2005 18:29    Post subject: View user's profile Send private message Reply with quote

That does sound odd... That item SHOULD make the wall perfectly un-passable to the player... Are you sure that it has been set off correctly? I don't recall getting a trigger to work without setting an Event to the trigger, and an Event_mask to the elevator sector.

I suggest you add something the following two lines, and try it.
  • To the trigger surface, add the line EVENT: 2048 (special event 1)
  • To the elevator sector, add the line Event_mask: 2048
Try that, it might have a good chance of getting the thing working...

And personally, I never use trigger_single. Rather, I prefer trigger_switch1.

_________________
Wake up, George Lucas... The Matrix has you..

Display posts from previous:   
Post new topic   Reply to topic    DF-21 Forums Forum Index -> Dark Forces Levels & Editing All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group