&NEIGHBOURS

Discuss Chaos Strikes Back for Windows and Linux, an unofficial port of Chaos Strikes Back to PC by Paul Stevens, as well as CSBuild, an associated dungeon editor.

Moderator: Zyx

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

&NEIGHBOURS

Post by Adamo »

Paul Stevens wrote:

Code: Select all

&NEIGHBORS


&NEIGHBORS ( location criteriaMask . . . result )

This word looks at the four neighbors of a cell and sets a bit in the result for each of the
neighbors that meets the criteria described by the criteriaMask.  This word might be 
useful to determine an escape route for the party, for example.

Bits in the result are:
bit 0 - North
bit 1 - East
bit 2 - South
bit 3 - West

The criteriaMask is divided into three sections:

1 - type of cell - bits a through b
2 - contents of cell - bits c through d

In order for a bit to be set in the result, the cell must match at least one bit in the 'type of cell' section and at least one bit in the 'contents of cell' section.

The 'Type of Cell Bits' are
bit 0 - Cell outside the dungeon (seen as a stone wall)
bit 1 - Solid stone wall
bit 2 - Real pit - open
bit 3 - Real pit - closed
bit 4 - False pit - cannot fall through
bit 5 - Door - open
bit 6 - Door - mostly open
bit 7 - Door - half open
bit 8 - Door - mostly closed
bit 9 - Door - closed
bit 10 - Door - smashed
bit 11 - Teleporter (objects only) active
bit 12 - Teleporter (objects only) inactive
bit 13 - Teleporter (party/objects) active
bit 14 - Teleporter (party/objects) inactive
bit 15 - Teleporter (monsters only) active
bit 16 - Teleporter (monsters only) inactive
bit 17 - Teleporter (anything) active
bit 18 - Teleporter (anything) inactive
bit 19 - Open
bit 20 - Trick Wall visible but passable
bit 21 - Trick Wall visible and impassible
bit 22 - Trick wall invisible and passable
bit 23 - Stairs up
bit 24 - Stairs down

The 'Contents of Cell' bits are:
bit 31 - Empty of monster or party
bit 30 - Occupied by monster
bit 29 - Occupied by party

Example.  Suppose you want to know in which direction the party
could proceed without falling through a pit or being teleported
or moving to a different level.  The criteriaMask should have the following bits set:

bits 3 and 4 - a safe pit.
bits 5 - an open door
bits 11, 12, 14, 15, 16, and 18 - inactive/nonparty teleporters
bit 19 - an open cell
bits 20 and 22 - a passable trick wall
bit 31 - No monster is there
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

I`ve got a question: can I change different types of cells using DSAs (&NEIGHBOUR command)? I mean for example closed door (bit9) to teleporter anything active (bit17). I know I can already change some using simple actuators, like:

- bit2 to bit3
- bit3 to bit2
- bit4 to bit2
- bit5 to bit9
- bit9 to bit5
- bit6 to bit5
- bit7 to bit5
- bit8 to bit5
- bit6 to bit9
- bit7 to bit9
- bit8 to bit9
- bit11 to bit12
- bit12 to bit11
- bit13 to bit14
- bit14 to bit13
- bit15 to bit16
- bit16 to bit15
- bit17 to bit18
- bit18 to bit17
- bit19 to bit20
- bit20 to bit19
- bit21 to bit22
- bit22 to bit21

Can I change, for another example, stairs up (bit23) to stairs down (bit24)? That would be a kind of changing path: when it`s set, you walk downstairs, when it`s not- upstairs (I used to do this in DMjava editor; there were stairs down on the upper level and stairs up on lower level on the same positions, of course. That was actuated by a switch; when the switch was on, stairs up were changing to stairs down, wchich means you went to level BELOW, not ABOVE). Etc, etc. There are... i guess if it is, there would be 144 possibilities in sum.

I guess that`s how the actuators are working? changing closed doors to open doors etc.? Why not let the DSA to change... stairs up to stairs down? Pit to a door? etc
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

oooohhhh I`ve got it!! there are only 6 types of celltypes!!!

http://www.dianneandpaul.net/CSBwin/doc ... ation.html

sorry for a mess!

but can I modify cell`s properties using DSAs? i heard someone changed CLOSED door to BASHED door using DSA only.

So I`ve got some ideas:

1. I want to change the stairs destination (up/down)

2. I want to change the doors properities (open to mostly open, mostly open to half open, half open to mostly closed, mostly closed to closed and closed to mostly closed, mostly closed to half open, half open to mostly open, mostly open to open). For example: opening closed doors would require 4 keys; first key changes its state to mostly closed, second to half open, third to mostly open, forth to open).
OR a mostly closed door, wchich changes its state durationally like this: mostly open -half open - mostly closed - half open - mostly open - half open - mostly closed - half open etc. You would have to go through them when they`re in proper state (= mostly open).
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

See:

http://www.dianneandpaul.net/CSBwin/doc ... ation.html

The asterisks show what CANNOT be modified.
Up/Down cannot be modified.

You can change the destination of a teleporter
if you want to change the dungeon's connectivity.
"TAKE A RIDE UP OR DOWN"

You can also see that a door's state cannot
be modified except to bash or unbash it,
add or remove the switch, make it bashable,
change its opening direction. You cannot set
it half-open.
Post Reply

Return to “Chaos Strikes Back for Windows & Linux (CSBWin) / CSBuild”