Misc DSA questions

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
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Question: why does &PARAM need reverse syntax to @MONSTER (&PARAM needs numbers of slots (20) then starting slot number (0), second needs starting slot number (21) then number of slots to be used (7). Not important, jsut want to be sure I understand it right!

Also, how do alter the value of parameter A or B (apologies if I've missed the doc where it is mentioned)
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

need reverse syntax
Laziness on my part. I make these things up as
I go and, although consistency in in the back of
my head as an important feature, I did not take the
time to compare the design of the new 'word' with that
of old 'words'. (The word 'word' is from Forth, a very
common programming language for microcomputers
back in the old days and what the DSA language is
sorta modeled after. You might call them 'operators' or
'functions'.)
how do alter the value of parameter A or B
'SA', 'SB', etc.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Ah, simple as that for parameters....and it would take the last value from the stack? So to alter a target destination just put the integer value derived from your forumla into the stack, for example?

Once you get into this DSA stuff it is kinda easy to get! (even though I'm having troubles aready!)
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

That is all correct. The word 'SB' removes the top value
from the stack and stores it in Parameter B. If you later
use parameter B as a message desination then the message
will go to wherever you computed.

Computing destinations like that should be avoided if
possible. It ain't always possible, I will admit. But that
would be a rare case. If you want the destination to be one
of 10 different cells, for example, it would be better to
put those 10 'addresses' in 10 parameters (A, B, C, ..., J )
and then choose the proper parameter.

The reasons are several. An important reason is that it
makes the targets visible to the editor so that you can
see them on the map. And the editor does not complain
about the targets having no triggers.
it is kinda easy
It is easy. It's just different.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

By other parameters I assume you mean other DSAs waiting in the wings to be triggered soley to activate two items each, like a relay?
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

No, no. You put a DSA that you want to activate as
the first DSA in a Cell. Then put several more DSAs in
the same Cell. These additional DSAs should probably
be designed to do nothing because they will get activated.
But they are valuable even if they do nothing. They
contain parameters C, D, E, etc. Two in each.

Your way would work as a binary tree of DSAs. But, although
clever, it is much more difficult because you need to pass
information from one to the next and the only easy way to do
that is by the type of message you send and there are only
twelve types. (There is another way but I won't try to explain
that until it is needed.)
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

I used the hitpoints of a lonely monster to store a permanent reference accessible to all the DSA. ^ ^
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Oh my God what a clever fellow!!!!! This is the kind of
guy who would make good use of Clones!
-------------------------------------------
I can provide a way to save an array of numbers
if you need more room. But your way of saving
one number is relatively efficient. Unless that
Screamer bumps his head on a wall and loses a
few hitpoints. :wink:
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Ah, no I understand - I did wonder of the logic of losing one parameter (targetting the next DSA perhaps) to gain two aswell - I will claim tiredness that having them all in the same place did not occur to me sooner : )

I assume that to have more messages accepted you would need two input messages - the first instantaneous as a state (or DSA, perhaps!) selector (say S/C0) and then a second a 1/6 of a second later as the seconary input to the ten remaining inputs slots, giving you 20 (or 39 for three, 48, etc inputs) Is there a more elegant way?
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Let me get this straight.

A DSA can accept 12 different messages. From 12
different pressure pads, eg. You want more? If
you really need more, I can provide them. Convince me
here in this forum or offline (if secrets are involved)
that they are really needed. The Master/Slave structure
is not implemented yet but is waiting for someone to
need it. It will be quite a bit of work to implement.

Another simple way is to have multiple DSAs at different
locations. Each can receive 12 different messages. Each
encodes its message (in a monster's hitpoints?) and then
activates the 'main' DSA that uses the CASE structure
to distribute the messages. Gotta be careful about
multiple, simutaneous activations however. If multiple
activations are possible you would need my better way
of passing arguments with the messages. It already exists.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

No, currently twelve is enough for me (more than enough! You mentioned there was a method and I just wanted to understand it in the unlikely event I needed to expand later.
Post Reply

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