Latest revision bugs

Report bugs, errors and balance issues you may encounter ingame here.

Moderator: Developers

Post Reply
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

No luck. The random number lists seem properly generated (RANDIE).

I did some more testing where I made a script give a randomized number output every 25 ticks. (rand % 100)
The number seemed properly random generated at first try:
17
70
81
30
12
19

In the next test I made the script generate 4 random numbers upon spawn:
31
50
60
34



I now tried to restart the module with both script snippets (first 4 generated on spawn then one continuously generated every 25 ticks). I got the same random results every time I restarted the module (which was 4 times).

[edit]I tried using the AND to randomize numbers as well (rand & 100). 4 numbers were generated upon IfSpawned. I got this result:
36
100
64
36
4

The result was same every time I restarted the module.[/edit]
bgbirdsey
{]-[0{0|307 (Developer)
{]-[0{0|307 (Developer)
Posts: 1864
Joined: Wed Jul 23, 2008 4:22 am
Location: Minnesota, USA

Post by bgbirdsey »

Yes, well, the srand stuff is all just about the rand() function calls in C! :)

To re-randomize the rand calls in the script, we need to say something like

Code: Select all

    srand( pinst->seed );
    pinst->randsave = rand();
    randindex = rand()& MAXRAND;


in module_start()...
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

Ah of course, because randindex would be 0 until RANDIE was called for the first time. And I think
randindex = rand() & MAXRAND-1;
would be more correct, unless we get an array out of bounds error?
bgbirdsey
{]-[0{0|307 (Developer)
{]-[0{0|307 (Developer)
Posts: 1864
Joined: Wed Jul 23, 2008 4:22 am
Location: Minnesota, USA

Post by bgbirdsey »

UGH! I meant

Code: Select all

randindex = rand() % MAXRAND;
bgbirdsey
{]-[0{0|307 (Developer)
{]-[0{0|307 (Developer)
Posts: 1864
Joined: Wed Jul 23, 2008 4:22 am
Location: Minnesota, USA

Post by bgbirdsey »

I made a couple of changes to your book pricing code:

Code: Select all

// Make sure spell books take all their shop properties 
// from their spell and not their book itself
if( SPELLBOOK == pchr->model )
{
   if( SPELLBOOK == pchr->basemodel )
   {
      // this is definitely a book
      // handle it normally
      icap = pchr->model;
      skin = pchr->skin;
   }
   else if( VALID_CAP(pchr->ai.content) )
   {
      // a normal spellbook?
      // take the values from the spell info
      icap = pchr->ai.content;
      skin = pchr->money % MAXSKIN;
   }
   else if( VALID_CAP(pchr->basemodel) )
   {
      // this is an object of some kind that was transformed into a book?
      // take the values from the basemodel.
      icap = pchr->basemodel;
      skin = pchr->skin;
   }
   else
   {
      // this is some kind of corrupted object that is now stuck as a book?
      // take the values from the book model.
      icap = pchr->model;
      skin = pchr->skin;
   }
}
else
{
   // this is not a book at all
   icap = pchr->model;
   skin = pchr->skin;
}
price = CapList[icap].skincost[skin];
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

Nice. I noticed there were some issues around the game where only skin 0 has the proper value and the other three skins had a value of 0 (since Egoboo only used the first skin to calculate price before). I think I fixed most of them, but there are probably more (we'll just have to find them and fix em).

You will notice you get a strange random message if you try to sell a item like that in a shop. (Maybe the "worthless item message" isn't working properly anymore?)
bgbirdsey
{]-[0{0|307 (Developer)
{]-[0{0|307 (Developer)
Posts: 1864
Joined: Wed Jul 23, 2008 4:22 am
Location: Minnesota, USA

Post by bgbirdsey »

Maybe it has something to do with the script and the expected skin # vs. the actual skin #? It seems most likely to be a problem in the script, since that is what would choose the lines from message.txt?
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

Messages are handled through the selfcounter that is set through the shop order. Buying and selling is handled by setting selforder (the price) and selfcounter (buy, sell, not enough, steal or worthless). My guess is that the Worthless "order" is not coming through properly (instead sending it's actual order count causing a very different message to be sent).

The script states
tmpargument = 5 + selfcounter
5 because that's the shop messages start in that particular message.txt, which in this case means

message 5 is buy
message 6 is sell
message 7 is not enough
message 8 is worthless item


Other bugs I noticed:
- Torches are still difficult to light. I had to jump on top of a brazier and drop the torch in the middle to get it to flame. Not very intuitive.
- I noticed that the naming for my saved characters would get messed up. I have a Healer, Viking and Wizard in my player list. For some reason all players end with the same three letters as my wizard (in this case "er"):
Adventurer
Eriker
Annigaler

I do not know if this affects only the name displayed in the menu or actual character exporting to a new folder.
- Characters that can jump more than one time reset their jump count before landing.
- Animated tiles on the mesh don't work (see first room in Ash Palace for example where the tiles break). I noticed the animated tile in the Healer starter did work, so this is maybe something wrong with the script function BreakTilesInPassage or something like that?
- The gong sound doesn't play anymore. Maybe IfCleanedUp isn't properly triggered or the camera moves away from the sound origin too fast to be heard?
User avatar
penguinflyer2222
Queen Penguin (Senior Member)
Queen Penguin (Senior Member)
Posts: 6614
Joined: Wed Jul 23, 2008 1:51 am

Post by penguinflyer2222 »

Zefz wrote:- Torches are still difficult to light. I had to jump on top of a brazier and drop the torch in the middle to get it to flame. Not very intuitive.

I tried to light one from a sandweg shop from the flames that appeared when I blew up the shopkeeper (lol) and couldn't get it to work, although I'm not sure if that would normally work anyway.
Zefz wrote:- I noticed that the naming for my saved characters would get messed up. I have a Healer, Viking and Wizard in my player list. For some reason all players end with the same three letters as my wizard (in this case "er"):
Adventurer
Eriker
Annigaler

Got this bug too.. sometimes the characters' names would end in "ad" from Pupkinhead.
Zefz wrote:I do not know if this affects only the name displayed in the menu or actual character exporting to a new folder.

I know that it doesn't affect the folder's name, at least.
......
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

- I fixed the strange name error.
- Fixed the gong sound missing.
- Also fixed the shop message bug!

I found out what caused the tiles not to break when stepped upon. Every function that changes tiles (SetTileXY, BreakTilePassage, etc.) which simply changes

Code: Select all

 PMesh->mmem.tile_list[cnt].img 

to a different texture number does not work correctly.

It changes into the wrong texture number for some reason. The door texture for the Archmage trials changes into a different texture than it is supposed to, meteors in Fire Domain no longer make an impact crater and of course tiles that break don't break at all. Any ideas?
bgbirdsey
{]-[0{0|307 (Developer)
{]-[0{0|307 (Developer)
Posts: 1864
Joined: Wed Jul 23, 2008 4:22 am
Location: Minnesota, USA

Post by bgbirdsey »

I haven't looked to see what is happening. Is the tile turning black, disappearing, or not changing at all?

You certainly have to make sure that the value for the tile is less than 255 of there will be trouble. The img field must be working pretty much as before or rendering the mesh would not work properly.

It may be that there is an error in the function that is supposed to change the tile image. It might be rejecting valid tiles instead of allowing them. Check for the proper use of the macro VALID_TILE() in that function.
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

Yeah, the texture type is valid and the tile is valid. The breaking tiles in Ash Palace and the craters from meteors in the Fire Domain seem not to change at all.

While the tile in Bishopia changes to a wrong tile (some part of a ship). It is probably worth to note that the tile in Bishopia is a Big tile (made up from 4 smaller tiles).

[edit]I fixed the unlimited jumping bug as well. Only one left is the one mentioned above I think.[/edit]
User avatar
Maxaxle
Darkshine Knight (Extremist fanatic)
Darkshine Knight (Extremist fanatic)
Posts: 4035
Joined: Fri Jul 25, 2008 8:16 pm
Location: San Diego, CA
Contact:

Post by Maxaxle »

To me it seems that "randomizing" isn't as random as you'd think...Does that count as a bug?
"Failing to plan is planning to fail."
Bug me if you want to play a game.
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

That's exactly what the five or six or so posts above was about. And the bug was found and fixed.
User avatar
Shade
Potion Mimic (Senior Member)
Potion Mimic (Senior Member)
Posts: 7349
Joined: Thu Jul 24, 2008 12:25 pm
Location: Gensokyo

Post by Shade »

Maxaxle wrote:To me it seems that "randomizing" isn't as random as you'd think...Does that count as a bug?

MDRT
Post Reply