Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Weird values? Do you get them too?

Author
Message
MikeHart
AGK Bronze Backer
20
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 26th Nov 2016 11:46
Sometimes I wonder if the interpreter retrieves wrong values. I can't repeat this consistantly.
I have types stored inside a list (array). Sometimes I retrieve values out of a field of a type that can't be possible in the first place.
I wonder if the interpreter fucks it up.
Do you get these weird values to that you can't pin down in your code?
-----------------------------------------------------------
Using AGK2 Tier 1
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 27th Nov 2016 08:11
hmm,
all values from a type or just one from it?
maybe rename it so you find all occur.
which agk version?
the only manner in this kind i had in past with more than 9+ parameter fields at a function.

AGK (Steam) V2.0.21 : Windows 10 Pro 64 Bit : AMD (16.6) Radeon R7 265 : Mac mini OS Sierra (10.12)
MikeHart
AGK Bronze Backer
20
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 27th Nov 2016 13:00
Version 2.0.21 , the current one. I tracked it down to the Random function. If you feed it with negative numbers, then it spills out numbers that are not in the range. I will try to repeat it with a small example.
-----------------------------------------------------------
Using AGK2 Tier 1
MikeHart
AGK Bronze Backer
20
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 27th Nov 2016 13:07
Here you go. Just read the docs. Random only spits out numbers from 0-65335.


-----------------------------------------------------------
Using AGK2 Tier 1
damothegreat
User Banned
Posted: 27th Nov 2016 13:12 Edited at: 27th Nov 2016 13:15
Sorry to say that the random function only works with positive numbers

Press F1 on the command for more info

To return a negative (which your after) - just simply call

eg.



damo
Using Tier 1 AppGameKit V2
Started coding with AMOS
Anything is possible if put mind to it
MikeHart
AGK Bronze Backer
20
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 27th Nov 2016 14:30
Or use Random2.
-----------------------------------------------------------
Using AGK2 Tier 1
damothegreat
User Banned
Posted: 27th Nov 2016 14:42
Yep - random2 works

Using Tier 1 AppGameKit V2
Started coding with AMOS
Anything is possible if put mind to it

Login to post a reply

Server time is: 2024-04-27 00:56:09
Your offset time is: 2024-04-27 00:56:09