Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Thu Mar 28, 2024 5:42 pm
All times are UTC + 0
Failure of SpyEffect at StolenMoneyPercentage
Moderators: Ares Support Team at PPM, Global Moderators, Red Alert 2 Moderators
Post new topic   Reply to topic Page 1 of 1 [17 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
Kou
Civilian


Joined: 18 Jul 2018
Location: Shanghai, China

PostPosted: 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.
Reply with quote  Mark this post and the followings unread

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

Back to top
View user's profile Send private message
AlexB
Commander


Joined: 31 May 2010
Location: Germany

PostPosted: Wed Jul 18, 2018 12:07 pm    Post subject: Reply with quote  Mark this post and the followings unread

Oh, that's great.

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.

_________________

Back to top
View user's profile Send private message
TAK02
General


Joined: 28 Jun 2015
Location: It was Damascus.

PostPosted: Wed Jul 18, 2018 4:05 pm    Post subject: Reply with quote  Mark this post and the followings unread

AlexB wrote:
Multiplying something with 0 often results in a 0.

Wrong choice of words, or has Alex being part of Illuminati been confirmed? #Tongue

Back to top
View user's profile Send private message Send e-mail Visit poster's website ModDB Profile ID YouTube User URL Twitter Channel URL Skype Account
4StarGeneral
General


Joined: 14 Sep 2006
Location: Limbo

PostPosted: Wed Jul 18, 2018 5:12 pm    Post subject: Reply with quote  Mark this post and the followings unread

TAK02 wrote:
AlexB wrote:
Multiplying something with 0 often results in a 0.

Wrong choice of words, or has Alex being part of Illuminati been confirmed? #Tongue

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."

Back to top
View user's profile Send private message Send e-mail YouTube User URL
TAK02
General


Joined: 28 Jun 2015
Location: It was Damascus.

PostPosted: Wed Jul 18, 2018 5:38 pm    Post subject: Reply with quote  Mark this post and the followings unread

4StarGeneral wrote:
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 #Tongue)

Back to top
View user's profile Send private message Send e-mail Visit poster's website ModDB Profile ID YouTube User URL Twitter Channel URL Skype Account
cxtian39
Commander


Joined: 11 Feb 2016

PostPosted: Wed Jul 18, 2018 8:25 pm    Post subject: Reply with quote  Mark this post and the followings unread

Nay, 0/0 doesn't have to be infinity

_________________

Back to top
View user's profile Send private message Skype Account
TAK02
General


Joined: 28 Jun 2015
Location: It was Damascus.

PostPosted: Thu Jul 19, 2018 5:29 am    Post subject: Reply with quote  Mark this post and the followings unread

cxtian39 wrote:
Nay, 0/0 doesn't have to be infinity
0/0=1, like 10/10=1. Logic Very Happy

Back to top
View user's profile Send private message Send e-mail Visit poster's website ModDB Profile ID YouTube User URL Twitter Channel URL Skype Account
AlexB
Commander


Joined: 31 May 2010
Location: Germany

PostPosted: Fri Jul 20, 2018 9:23 am    Post subject: Reply with quote  Mark this post and the followings unread

You're taking me too seriously. Any natural number x times 0 is 0. This can be shown from the axioms. Believe it or not, I'm aware of that. Laughing

But x/0 is undefined, as 0 has no multiplicative inverse element.

_________________

Back to top
View user's profile Send private message
Kou
Civilian


Joined: 18 Jul 2018
Location: Shanghai, China

PostPosted: Fri Jul 20, 2018 1:30 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thanks to @AlexB. Thank you guys for the funny mathematical discussion. Laughing

Back to top
View user's profile Send private message
MRMIdAS
Energy Commando


Joined: 17 Jul 2008

PostPosted: Fri Jul 20, 2018 2:31 pm    Post subject: Reply with quote  Mark this post and the followings unread

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.

_________________
MIdAS - Turning wages into beer since 2002

Back to top
View user's profile Send private message
TAK02
General


Joined: 28 Jun 2015
Location: It was Damascus.

PostPosted: Fri Jul 20, 2018 2:37 pm    Post subject: Reply with quote  Mark this post and the followings unread

MRMIdAS wrote:
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 Very Happy

Back to top
View user's profile Send private message Send e-mail Visit poster's website ModDB Profile ID YouTube User URL Twitter Channel URL Skype Account
djohe
Cyborg Informer


Joined: 07 May 2006
Location: Sweden, Gothenburg

PostPosted: Sat Jul 21, 2018 3:00 pm    Post subject: Reply with quote  Mark this post and the followings unread

MRMIdAS wrote:
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.

Back to top
View user's profile Send private message
TAK02
General


Joined: 28 Jun 2015
Location: It was Damascus.

PostPosted: Mon Jul 23, 2018 9:04 am    Post subject: Reply with quote  Mark this post and the followings unread

djohe wrote:
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).

Back to top
View user's profile Send private message Send e-mail Visit poster's website ModDB Profile ID YouTube User URL Twitter Channel URL Skype Account
silverwind
Cyborg Firebomber


Joined: 11 Jun 2016

PostPosted: Mon Jul 23, 2018 1:31 pm    Post subject: Reply with quote  Mark this post and the followings unread

djohe wrote:
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.

Back to top
View user's profile Send private message
Mig Eater
Defense Minister


Joined: 13 Nov 2003
Location: Eindhoven

PostPosted: Mon Jul 23, 2018 4:06 pm    Post subject: Reply with quote  Mark this post and the followings unread

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.

_________________



Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID YouTube User URL Facebook Profile URL Twitter Channel URL
TAK02
General


Joined: 28 Jun 2015
Location: It was Damascus.

PostPosted: Tue Jul 24, 2018 9:03 am    Post subject: Reply with quote  Mark this post and the followings unread

Mig Eater wrote:
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? #Tongue

Back to top
View user's profile Send private message Send e-mail Visit poster's website ModDB Profile ID YouTube User URL Twitter Channel URL Skype Account
MRMIdAS
Energy Commando


Joined: 17 Jul 2008

PostPosted: Tue Jul 24, 2018 5:59 pm    Post subject: Reply with quote  Mark this post and the followings unread

TAK02 wrote:
Mig Eater wrote:
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? #Tongue

Only for comedy purposes

_________________
MIdAS - Turning wages into beer since 2002

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [17 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
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


Powered by phpBB © phpBB Group

[ Time: 0.1806s ][ Queries: 11 (0.0075s) ][ Debug on ]