PSEUDORANDOM issues in 1.3.3 [fixed]

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

PSEUDORANDOM issues in 1.3.3 [fixed]

Post by Rhuvaen »

Trying to convert some stuff over to 1.3.3, I'm having trouble with the PSEUDORANDOM macros.

This:

Code: Select all

{PSEUDORANDOM 5}
Will yield values all over the place ("33608..."). I'm still doing all the initialising as normal (I know how to use this).

Has anyone else had problems? Is there anyWML-related change that could break PSEUDORANDOM?
Last edited by Rhuvaen on June 18th, 2007, 4:27 pm, edited 1 time in total.
User avatar
Noyga
Inactive Developer
Posts: 1790
Joined: September 26th, 2005, 5:56 pm
Location: France

Post by Noyga »

I've seen this problem too, and notified EP from IRC (since he's the author) and this happens since 1.3.2.
I have no idea about what does break PSEUDORANDOM and didn't have time to look more closely what is wrong with PSEUDORANDOM and wesnoth >1.3.1.
"Ooh, man, my mage had a 30% chance to miss, but he still managed to hit! Awesome!" ;) -- xtifr
toni
Posts: 42
Joined: April 13th, 2007, 7:28 pm
Location: berlin, germany

Post by toni »

i tried it with 1.3.2, but it doesn't work to me, too. it returns strangely numbers instead the right ones. i don't know how the macro works, so i gave up.
i'm using random, which works nice, if you don't use it in multiplayer. so i just go on making my (multiplayer) map and hope it will work on 1.4.
but it would be really great if someone found the pseudo-bug.
aka mysticspiral
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Post by Rhuvaen »

Pah - I just remembered that I found that bug some time ago and fixed it, then lost that code and forgot about it...

You just need to replace all references of modx-{macro argument} with modx_{macro argument} (there are only two). Having a dash as part of the variable name was dodgy before, but now it is a downright bug. :wink:

I'm not even sure, but WML might have become smart enough to do a subtraction there? :D

I'll update the wiki macro code.
User avatar
Noyga
Inactive Developer
Posts: 1790
Joined: September 26th, 2005, 5:56 pm
Location: France

Post by Noyga »

Wow, great thanks !
"Ooh, man, my mage had a 30% chance to miss, but he still managed to hit! Awesome!" ;) -- xtifr
Post Reply