Posted: Wed Jul 18, 2018 5:40 am Post subject:
Failure of SpyEffect at StolenMoneyPercentage
Subject description: While a spy infiltrate any Ore Refinery, RevealProduction works but StolenMoneyPercentage not.
When Ares spy infiltration logic was applied to any Ore Refinery (say Allied Ore Refinery) to reveal the player’s credits and simultaneously steal cash, the credits could be seen but no cash was actually stolen. The EVA message only said 'Building infiltrated'.
Here lists only the lines appended to the original code in rulesmd.ini.
Code:
[GAREFN]
; appended to the original code
Cursor.Spy=StealCash ; Ares 0.D
SpyEffect.Custom=yes ; Ares 0.1
SpyEffect.StolenMoneyPercentage=0.5 ; Ares 0.1
SpyEffect.RevealProduction=yes ; Ares 0.B
SpyEffect.StolenMoneyPercentage= is documented as float, thus 0.5 would be half of the money.
It was committed in 2010 as being an integer percentage, that is, "50" should mean 50%.
Yet, it is coded as if it were a float, multiplying the value with the available money directly, never dividing by 100.
Thus, your 0.5 is read and truncated as an integer value 0, and the money is multiplied with that. Multiplying something with 0 often results in a 0. Stolen money percentage is capped at the actual value: you can't steal more money than there is. Thus, your only other option would be to use values equal to or greater than 1 to steal all the money.
That means, SpyEffect.StolenMoneyPercentage= actually works like a boolean: either steal everything or nothing at all.
Thanks, I'll fix this for the next release. _________________ QUICK_EDIT
Multiplying something with 0 often results in a 0.
Wrong choice of words, or has Alex being part of Illuminati been confirmed?
0 to the power of 0 can equal 1, the same as infinite multiplied by 0 cannot equal 0, nor can it equal 0 in a polynomial and some other complex calculus. _________________ "Don't beg for things; Do it yourself or you'll never get anything." QUICK_EDIT
infinite multiplied by 0 cannot equal 0, nor can it equal 0 in a polynomial and some other complex calculus.
Code:
Logic.exe has crashed. Hard.
Think we should do mathematical discussions elsewhere.
0 to the power of 0 (=0^0) is 1 by definition (i.e. pratically complete nonsense, but let's keep it to screw around with people's heads. Like anything/0=infinity ) QUICK_EDIT
Just code it so divide by zero triggers the games piracy protection and explodes your base after 20 seconds.
stick a line in the debug to explain it and you're golden.
seconded.
the only question is what should be divided zero when and how.
But Alex will figure something out, I'm sure. Why he even said himself he somehow managed to make not every multiplication with zero end up as zero QUICK_EDIT
Just code it so divide by zero triggers the games piracy protection and explodes your base after 20 seconds.
stick a line in the debug to explain it and you're golden.
Good idea but at the same time I personally hate all sort of copy protection on games especially the one in RA2 because it forces me to actually install the game and not just copy the game from one computer to another and how it sometimes has conflicted with modding for some people in RA2 community.
I am torn between both sides on this one but only as a bonus thingy that does not steal time from anything way more important.
I personally use division by zero for when I want to see if a code path is taken or some other lol debug things (it trips the error handler and displays some info in a section of RAM it for debug reasons) in a sega mega drive game I am modding at times. It is one of the easiest ways to trip some sort of error handler in a safe way on that console. QUICK_EDIT
I personally hate all sort of copy protection on games especially the one in RA2 because it forces me to actually install the game and not just copy the game from one computer to another and how it sometimes has conflicted with modding for some people in RA2 community.
Odd. I never had that happen to me, and I'm sure i just transferred the whole game to and from USBs several times.
But to be fair, it was always a Syria-bought copy (which means it most likely has already been hacked either via EXE or some file before-hand. It's also pirated for sure). QUICK_EDIT
Good idea but at the same time I personally hate all sort of copy protection on games especially the one in RA2 because it forces me to actually install the game and not just copy the game from one computer to another and how it sometimes has conflicted with modding for some people in RA2 community.
Can't you, though? I just copied over the whole Ra2 directory, including modding work from my old 'broken' laptop that, in what can only be described as a technological marvel, woke up from its year-long coma for a few hours for no obvious reason, just long enough for me to copy all important stuff to a hard drive. I adjusted the Registry keys to the new pc (directories, and all), and it's good and running without issues on April 2018 update, to boot.
And now the old laptop is dead again, possibly forever. QUICK_EDIT
BTW Ares disables the "exploding units" piracy protection, so you can copy the RA2 files anywhere you want & even run them off a USB stick if you want. _________________
BTW Ares disables the "exploding units" piracy protection, so you can copy the RA2 files anywhere you want & even run them off a USB stick if you want.
Think we can request it as a feature tho? QUICK_EDIT
BTW Ares disables the "exploding units" piracy protection, so you can copy the RA2 files anywhere you want & even run them off a USB stick if you want.
Think we can request it as a feature tho?
Only for comedy purposes _________________ MIdAS - Turning wages into beer since 2002 QUICK_EDIT
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum