Attack and program crasheds(illegal operation) (CSBwin)

Dead posts cluttering up the front page of certain non-RTC forums are kept here. Threads have the forum subject attached, except custom dungeon threads (which are obvious)
Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
ADDF_Toxic
On Master
Posts: 623
Joined: Wed Apr 27, 2005 2:43 pm
Location: Canada
Contact:

Attack and program crasheds(illegal operation) (CSBwin)

Post by ADDF_Toxic »

I have recently started using CSBuildv214 on my dungeon rather than v196 because I needed a party attack filter, which 196 did not have. Now, it crashes (gives me an illegal operation message) whenever I attack an enemy. I have tried to update to the latest CSBWin (unless I'm wrong, it's 111) and that didn't work. Waiting for a while then trying again also didn't work. Does anybody have any suggestions? Thanks.
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

what's the code in your 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 »

The DSA filter capability will NEVER be totally
idiot-proof. But I try to remove some of the
simpler-to-fix problems. (The low-hanging Apples).

If you send your dungeon.dat file to me I will see
if this is something I can repair.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Was there a message with your crash? You should always report messages. With DSAs always assume it is your code first before the engine. Easy mistakes to make are to not put enough variables onto the stack before trying to do somehting (generates a stack underflow error which crashes the game), put the game into a permenant loop (the game will just freeze, you do that by say putting the equivalent of S0: JS0 so the filter will nevre break out and end. Also, be wary of targetting effects outwith the level, last time I checked (I usually have code making sure this doens't happen) the engine can crash too. So for example, trying to &cell@ to look at a tile with a negative x or y value is a bad idea
User avatar
ADDF_Toxic
On Master
Posts: 623
Joined: Wed Apr 27, 2005 2:43 pm
Location: Canada
Contact:

Post by ADDF_Toxic »

What's with DSA? Is it because I said party attack filter? I think (but I don't remember) it crashed once when I tried it on my level with the party attack filter, but more crashes were encountered while battling an animated armour (Oh, no, not those things again!). The first time I attack him, it freezes. And yes, I get a message, but I don't have a "send" or "don't send" button on it, just "close" and "details". And if you meant a CSBWin message, no-it's a windows message. The party attack filter is being used for my fuse chaos.
So my code that uses the party attack filter is:

Code: Select all

Description = Fusing Chaos
State = 0
StateLocation = 0
GroupID = 0
Number of States = 2
First Displayed State = 1
Number of non-empty states = 2
State Number = 0
Number of Actions = 2
S0 = L0 &@ L1024 &* L1 &@ L32 &* &+ L2 &@ L3 &+ &PARAM@
C0 = G1C0
State Number = 1
Number of Actions = 7
C0 = L1 L16 L15 LA L0 L1 L16 L15 LB L0
T0 = L15 L1 L2349 &ADD
S1 = L1 L16 L15 LA L0 L1 L16 L15 LB L0
C1 = L15 L1 L1261 &ADD
T1 = L1 L16 L15 LA L0 L1 L16 L15 LB L0
S2 = L15 L1 L2347 &ADD
C2 = LA L15 &SAY
signature = 5321E6FCD08DB2247756F84AB68F0A3D
I got that from the Export DSA thing. And it's not quite complete...is that the problem?
Oh right! When I first entered this newer version, it prompted me to set something that is in 214 but not in 196. It was something in Global info...the database editor. Maybe there is something else new that I have not encountered.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Off the top of my head the first thing I can see wrong is that the party attack filter doesn't give you your level depth, sorry!
L0 is actually the number of the character attacking (first position = 0)

To get the level depth, you can do a &party@ call, and then use the level depth there.

The second thing I can spot is that currently you are tryign to do an &param@ command (which retrieves the parameter variables for the party filter at the end - this will crash the game, as you haven't included the write literals before you do it

What you need to do FIRST is
L25 L0 &PARAM@ - this gets the 25 variables and puts them into the temporary array from addresses 0 to 24. 0 = member, l1 = x value, 2 = y value, etc

Your code is not actually doing anythign with this value you calculated, by the way. What you need to do is assign it to an arrayusing the &! command - so for example L10 &! would put the value into array '10'

I think you have misunderstood the way a DSA works, perhaps. Each line of code doens't automatically run. Line 0S0 runs because a message is set to activate line S0 when an attack starts. 0C0 will only run because a message is sent to C0 during the middle of an attack. Lines do not automatically follow one from the other. So for exampel code lines T0 - C2 will never run. And not that the array memory is flushed after each tiem the DSA runs. Or, in other words, if you don't do everything in the S0 call you will lose all your calculated values before the C0 call.

Don't worry, you are starting to get there, if we can see your code and see how you think the programme works it is much easier for us to tell you where thigns are going wrong.

So at the moment, remove that &param@ completely, and see if the programme still crashes - I would suspect that it won't

The thing CSBuild prompts you on is completely seperate from this issue
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

You also have the problem that if you put this DSA at the party attack filter location (which is the right thing to do), it will get activated ANYTIME you attack or make an item action, no matter the target.

What you need to do is to check that the action is "fuse", and the target is a monster of type "lord chaos", for example... I don't know what you're aiming at...
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

One step at a time probably!

Step 1 - avoid crash
Step 2 - set up DSA correctly
Step 3 - get rid of rubbish
Step 4 - what are you wanting to do? : )
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Well, at least he is not afraid to try!

I would put step 4) first in the list. :wink:
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Nah, writing fun things with the DSA comes first...you just kinda figure out what you want to do with it afterwards!
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Here was my party attack code so you can see what I did:

State 0:
S0: L22 L0 &PARAM@ L43 L1 &@ &!= ?JC1 L5 &@ L23 &= ?JS1 L25 L5 &@ &= ?JS1
C0:
T0:
S1: L1 L1 &! L22 L0 &PARAM! L23 L12 &PARTY@ L24 &@ L32 &* L2 &@ &+ L32 &* L3 &@ &+ L3 L255 &%CREATECLOUD LA L0 L22 L0 &MESSAGE
C1: N


In the first line I take the first 22 parameters of the attack and put them into the twenty-two arrays from '0' onwards. I then compare array value '1', which has become the number associated with the attack launched, with 43 which is the value for fusing. If a fuse attack hasn't been launched ( &!= means not equal) it jumps to the line with a no-operation and ends. Otherwise the code continues and takes the value from array '5', which is now the monster type number. It firstly compares it to 23, whcih is a lord chaos type monster. If it's chaos, it jumps to line S1. It then checks to see if its type 25 - lord order. If so, it does the same jump. Otherwise that is it, the DSA ends there, the array values are flushed.

I've left C0 and T0 empty becuase the attack will also trigger C0 and T0 in turn during the middle and end of the attack calculations.

In S1, the first thing I do is turn the value stored in array 1, the attack value from being fuse (43) to being a no attack (1). THis in itself does nothing, I have to push the values in the array back to the engin's parameters for it to affect the game (hence the L22 L0 &param!). Now, as I said, you can't get the level depth info from the party attack filter, so I next take the values of the charatcer (12 of them) and store them from array ''23' onwards. The only reason I am doing this is to calculate the location infront where chaos/order is standing (from '24', party level, and '2' and '3' which are y and x values of where the attack is) I use them to create a Zo explosion where chaos/order is standing. Why? Because i've disabled the fuse attack - nothing would show up otherwise! This way it fakes it so the player won't realise that fuse isn't working. And I disable the fuse attack so I don't accidentally trigger the real fuse ending and stop the game.

So, the final part of S1 is throwing the values gained from the party attack filter (because it's best to get out of a filter quickly) to the 'ending' DSA with all the fuse condition checks and animation. It is located at 'A', and I'm sending a message 22 items long. The other two numbers indicate a set signal (so it will activate the DSA at its line S0) and with no delay
User avatar
ADDF_Toxic
On Master
Posts: 623
Joined: Wed Apr 27, 2005 2:43 pm
Location: Canada
Contact:

Post by ADDF_Toxic »

It's either:
1. I'm not describing this properly (probably)
2. You're not reading it properly
3. I didn't say what I thought I said (posted)
4. I think these connections link worse than I thought (this thread to my fuse chaos thread)
Zyx, yes I am talking about Lord Chaos, I said something about my fuse chaos thread, maybe not specific enough.
Lol, that's why it crashes when I'm not even on chaos level. Now I just need to fix my DSA.
Beowuuf, that makes a bit more sense that the lines don't go one after another. I saw it in both ways, so it got confusing.
I just checked what &! means, and now what you're saying about storing things makes sense (blabbing about before, saying now).
Oh, didn't realize you could put two DSA's in one text box (Where you can type, I used the name Visual Basic uses for it, and maybe C++ too, if that's what was used). Ah, that's a bit off topic.
&!= means not equal
As the DSA reference did not make clear to me. Thanks for the explanation.
I tried removing my &PARAM line. Still crashed. I tried finding a way to take off my party attack filter, but I couldn't find a way...but I'm out of time for now...
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

I tried finding a way to take off my party attack filter
I think you are asking how to disable the Party
Attack Filter completely. 'Take off' is what airplanes
and strippers do.

Set the level to -1 (or set the location to some empty cell).
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

If only we could combine them, then we would be rich, rich I tells you!

I posted a reply and it seems I didn't submit... what I would do is take the basic DM dungeon, create a saved game with a party, then edit this saved game. Building a party filter from scratch here (you can add a chaos easily when you need him) and keep checking the gameplay each step (it is much faster to kill off your party, edit the sdaved game, then restart the saved game again). Once you are happy with your DSA, then you can use the export / import function to take the DSA from your saved game into your proper new dungeon
User avatar
ADDF_Toxic
On Master
Posts: 623
Joined: Wed Apr 27, 2005 2:43 pm
Location: Canada
Contact:

Post by ADDF_Toxic »

Interesting idea, beowuuf. Paul, I was wondering if the -1 thing would work, but I didn't feel like taking any chances because I worked so hard on this thing.
Tried the -1 thing, and it worked.
Post Reply