CSBwin modified to add custom spell effects?

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.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4319
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

I posted a new OverlayDemo and CSBuild147.

I implemented a CASE construct and used it to fix the spell filter
so that it affects only the ZO spell rather than all spells.

Some documentation of the Spell Filter cpability at:

http://dianneandpaul.net/CSBwin/documentation
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

I set the spell filter zone pointing to a ANd/OR gate, activated if in state 1. so a spell should activate it. It never happens.

another thing I did was putting a DSA that only respond to a S0 message if in state 1. If I put a pressure pad, activated by party, toggling this state, it works perfectly and the DSA intercepts the spells.
If I put a pressure pad, activated by monster, toggling this state, it doesn't work!!!?
User avatar
Paul Stevens
CSBwin Guru
Posts: 4319
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Casting a Spell does not send a message in the ordinary sense.
It looks for a DSA at that location and calls it as a subroutine to
process the filter paramters before casting the spell. If you want
to set an AND/OR gate bit then you must put a DSA at the Spell
Filter Location and the DSA can send a message in the ordinary way.
The Spell Filter really becomes part of the Spell-Casting code.

Your second problem seems a bit strange. Seems impossible. No idea.
Can you send a tiny dungeon demonstrating this problem?
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

Ok, understood for the AND/Or gate.

I think I got what is happening with the 2nd problem: when I send a set, south message to a DSA, that is, a S2 message, then the DSA is automaticly set to state 4.
And a set, west (a S3 message) sets it to state 8.

Is it on purpose?
User avatar
Paul Stevens
CSBwin Guru
Posts: 4319
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Goodness, no. It certainly is not supposed to change state
unless you tell it to. Have you looked at the TimerTrace when
you run your test?

By the way, Folks. I changed the title of this thread to remove the
digit '4' from the name of CSBwin. 'CSBwin' is a proper noun. It is not
spelled with a digit '4' thrown in between the third and fourth letters.
Just as my name is 'Paul', not 'Pa4ul'. ;-)
User avatar
purple1
Adept
Posts: 237
Joined: Wed Jul 14, 2004 5:04 pm
Location: California, USA

Post by purple1 »

Well, they do mean CSB for Win, but I guess that some people just dont even think about what they are talking about. What a shame.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

It can be...

"P4u1 r0x0rz!!!111"

*runs*
User avatar
purple1
Adept
Posts: 237
Joined: Wed Jul 14, 2004 5:04 pm
Location: California, USA

Post by purple1 »

OR
P4u|_ §†3\/e|\|§
l33t to the m4xx
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

Paul Stevens wrote: Have you looked at the TimerTrace when
you run your test?
I just did and from what I understand the DSA changes to state 8 just because of the S3 message.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4319
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Well, I just tried it and it entered state 67372036. Which is
0x04040404, which when truncated to 4 bits becomes 4. Not 8 as
you claim. ;-)

Hmmm...Perhaps I should look into this a bit further. It did not
used to do this kind of thing. Must be some sort of new feature.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4319
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

I posted version Alpha11 in OverlayDemo.rar.

I think the problem was that the DSA received a message for which
no program existed. Since the first command specifies the next state
and there was no first command, then the next state was undefined.
Fixed.

If your problem was different from this then you better ship me a
dungeon and playfile.log so I can investigate.
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

Yes, it works perfectly now. By the way, here's a suggestion for a predefined text: "The spell fizzles and dies." Or maybe just "the spell fizzles."
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

I forgot: I think you should remove the overlay effect during the sleep, it gives strange results (accelerated time), and anyway the eyes are closed...
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

I found a bug: I load a savegame with some DSA in the dungeon. I die. I reload. I get a "duplicate DSA" error and CSBwin crashes.

Other remarks:
Could you enlarge the "edit champion text" dialog?
I can't see the butons at the bottom.

Could you enlarge the "locations" dialogs, which is displayed after searching for an item?
I can't see the tiles at the bottom, and I can't see the list of locations on the right.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4319
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

New versions of both programs have been posted.

It is fortunate that God provided us with a wealth of integers.

=====================
What is it about your machine that causes Dialogs to be differently
sized? A different system font size? A monster screen size like 2048x1536?
Whenever I specify a size for a window it fails to work properly
on some machines. I have never figured this out.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4319
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Some more research leads me to believe that you have a system
font larger than the default. This pushes everything down and to the
right in dialog boxes. I have (hopefully) fixed the immediate problem
by abandoning my efforts to resize the dialogs depending on their
contents. I now let the system do whatever comes naturally.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4319
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Be sure to get CSBuild 1.49. I fixed an additional problem
with loading games created by the latest CSBwin.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4319
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Newly posted OverlayDemo.rar and CSBuild150.

Fix invisible dropped large monsters.
Allow DSAs to interchange aritrary data.
DSAs can cast spells.

See overlay demo for simple demonstration of modified
spell casting. Find the Apple.
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

There's something I don't understand:
1T0: L$ L0 L10 L30 OP3 &MESSAGE L1 L0 &! L1 L0 &PARAM!
L$: the target tile
L0: a set message
L10: 10 parameters
L30: ????
OP3: so this will be a S3 message.


What is the "30" value for?
User avatar
Paul Stevens
CSBwin Guru
Posts: 4319
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Sorry. The 'Help' does not show the fourth parameter: Delay.
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

I just figured it out by messing with the value before reading your answer. These new features for the DSA are very powerful!

Your sample dungeon is becoming the weirdest errand I ever ran. I think we're entering the surrealistic era of DM.

Is there a way to make a DSA that at first, blocks all the spells, then allow them one at a time (ie, once you find the formula on a scroll), without using millions of states?
User avatar
Paul Stevens
CSBwin Guru
Posts: 4319
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

I anticipated that question. That is why I built the 'CASE' construct and
the message with parameters.

The answer is 'Yes and No'.

There are not 'millions' of spells. So you don't need millions of states.
My plan was to plant a DSA for each possible spell. They can all be
identical. So that is only three states. The DSA at the 'Spell Filter'
location looks like this:

Assume there are 5 spells to handle: 1,6,24,343,and 32

0s0 first rune case {(1,0c0), (2,0t0), (3,0s1),(6,0c1)} //default is do nothing
0c0 second rune case {(0,0t1)} // 1xxx
0t0 second rune case {(4,0s2)] // 2xxx
0s1 second rune case {(2,0c2),(4,0t2)} // 3xxx
0c1 second rune case {(0,0s3)} // 6xxx
0t1 message to DSA 1000
0s2 third rune case {(0,0c3)} 24xx
0c2 third rune case {(0,0t3)} 32xx
0t2 third rune case {(3,1s0); 34xx
0s3 message to DSA 6000
0c3 message to DSA 2400
et ceteraa

Each of the lines that sends a message simply loads
the target location onto the stack and jumps to a
common state that disables the spell silently and sends
the message.

So each possible spell requires about 2 more lines of code.
(Plus log base 2......sorta) But it scales approximately linearly.
And it is fast because no case statement has more than
seven possibilities and no spell requires more than three such
statements.
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

ah yes, you got it all planned! I'll try to fiddle with the CASE statement in the next days.

Two reports:

The poison bolts keep doing naught, at least to the party.

Also, CSBwin keeps removing "too many monsters of size 4" when loading. Remember this old bug it is now a feature to make invisible monsters :)
User avatar
Paul Stevens
CSBwin Guru
Posts: 4319
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

I am afraid that the monster business really should be considered
a bug, not a feature. But would you believe that there are five unused
bits in the monster record???? I didn't believe it. Bu I have searched
rather thoroughly and it appears to be true. We could appropriate
one of those bits for an 'invisible' flag.

CSBwin cannot use only that bit to make monsters invisible because
there may be old games in which the unused bits are non-zero. So I will
add an option in CSBuild to allow the invisible monsters
and I will add code that provides a warning if the bit is set but the
option is not selected. This will make it easier to convert old games......
First deselect the option and check that no bits are set. Then select
the option and mark any monsters that you want invisible.

Next comes the problem of monster generators. Will they be able
to create invisible monsters? I have not looked into this yet. But,
since I increased the size of ALL Actuators by sixteen bits, it should
be easy.

QED
User avatar
cowsmanaut
Moo Master
Posts: 4378
Joined: Fri Jun 30, 2000 12:53 am
Location: canada

Post by cowsmanaut »

Isn't it common practice to leave open variables just incase you need them for something later? DM was rather experimental in it's time.. I would think it possible they wanted to have a lot of things done and so left it open for extra attributes.. After all there are a few unused items in the code right? That in the least should show that they tended to plan for larger than they had time to make.

sorry.. now I'm going off topic.. quick.. blame Fuzzface ;)

moo
User avatar
Paul Stevens
CSBwin Guru
Posts: 4319
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

The folks at FTL wasted nothing. They had a terribly difficult time putting
that game onto a single floppy and fitting it into 512 KByte. They left a
few unused things around but it was not done intentionally. Some may have
been left over from things they tried to fit into the game but were unable.
A few bits here and there are mostly the results of having to allocate in
16-bit pieces and only needing 14 or the fact that (for example) monster
generators and AND/OR gates share the same record structure but obviously
do not share ALL the same required fields. In my case, I used the 'Normally-Closed'
bit of the Monster Generator for the invisible bit because it is not needed by
Actuators that do not create messages.

The latest OverlayDemo and CSBuild 1.51 have the invisible monster capability.
Even the Monster Generators seem to work. I did not test very thoroughly so
let me know if you find problems.
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

I checked the invisibility and it seems to be working.
But this is a "group invisibility" and only solves some situations.
I alos used the trick of putting several large monsters on a same tile to obtain a visible monster backed up by invisible allies. Could you prevent CSBwin to check the size of creatures if the dungeon is set as containing invisible monsters? Besides CSBwin changes the dungeon only when loading the savegame, but not during the play, so this is a discrepancy: you will get two different dungeons according to wether you keep playing or save and reload.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4319
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

But this is a "group invisibility"
What do you want? A group of four mummies, three visible and
one invisible?
changes the dungeon only when loading the savegame, but not during the play, so this is a discrepancy
You are right. I think you mean that two dragons can be created on the
same cell using a monster generator. I have fixed that. I give a single
warning and then subsequently fix it silently.

You simply cannot put more than one dragon (or two worms) on a single
cell. You cannot put six mummies on a single cell. The code is much too
convoluted for me to be able to guarantee the integrity of the game. Things
like the monster movement, turning, missile/monster collision are all
dependent on these rules. The fact that two dragons are invisible is
an example of the code going astray when the rules are broken. Invisibility
is harmless but it was just luck that the program did not crash.
visible monster backed up by invisible allies
You can have a Dragon drop an invisible Dragon when he dies.
Post Reply

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