Release My science project
#1
Lightbulb 
I saw this post that @SuperNovaAO made:

(09-01-2011, 18:51)SuperNovaAO Wrote:
Code:
while (int(bar) != bar) { bar = 10 * bar; }

To get 0 digits after the . after cutting the front of.

And yes, this is probably still faster than string manipulation since string manipulation the slowest thing possible is for computers (computers are made to calculate, not read).

and I was like
[Image: 9763578.jpg]

So I decided to use
Code:
numfunc(num) { num += " "; num = StrTok(num,"."); return int(num[1]); }
On a X number of variables to see what happens.

But I couldn't use a simple for loop ingame because the game would recognize it as an infinite loop. So I wrote a simple C# program that made a lot of variables (source here, without the forms).
I first tried it with 1000 variables, and that went fine. Then I stepped it up a notch or two and tried 100k variables. Now the map wouldn't load because the filesize was over 9000kb. Error:
Code:
Hunk_AllocateTempMemoryHigh: failed on 10022177 bytes (total 5 MB, low 0MB, high 9MB)
Then I tried 50k (or something), the file size was now less then 5MB so it could load... OR NOT. A new error appeared:
Code:
exceeded maximum number of script strings
Then finally I tried 10k and it worked, the file size was only a bit over 900kb. According to game time it finished in less then a millisecond.

Conclusion: The game doesn't care about resources used, or how they are used. Gsc files are safe enough to use anything you want, you don't have to care about performance. You just have to be careful that your gsc doesn't exceed the 5MB limit and that it doesn't use/set too many strings.
Final file: http://cfgfactory.com/kc/pozzuh/20kcode.gsc (it was too big to put on pastebin)

The attached file is the program I made to make the big file. You can change how many arrays and values per array in the program.



Attached Files
.rar   SMS by Pozzuh.rar (Size: 4.6 KB / Downloads: 46)
[Image: MaEIQ.png]

#2
Awesome
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu


#3
In english what does that do?
Cool DGT The Best Of The Best

Do Not Rep+ Me For Helping

Rep+ If You Liked

Donate Here:
Any Donation Accepted

#4
(09-04-2011, 20:35)Scripts18 Wrote: In english what does that do?

Make a lot of variables
[Image: MaEIQ.png]

#5
(09-04-2011, 20:39)Pozzuh Wrote:
(09-04-2011, 20:35)Scripts18 Wrote: In english what does that do?

Make a lot of variables

For?

(I challenge you to explain it to me)
Cool DGT The Best Of The Best

Do Not Rep+ Me For Helping

Rep+ If You Liked

Donate Here:
Any Donation Accepted

#6
(09-04-2011, 20:41)Scripts18 Wrote:
(09-04-2011, 20:39)Pozzuh Wrote:
(09-04-2011, 20:35)Scripts18 Wrote: In english what does that do?

Make a lot of variables

For?

(I challenge you to explain it to me)

read the fucking topic
[Image: MaEIQ.png]

#7
Confused what does strTok do?
YouTube 1:Azumikkel- Modding
YouTube 2:DerpShark- Gaming Entertainment
Website:Jensby.me
Contact: [email protected]

#8
Pozzuh I read it but its like chinesse for me
Cool DGT The Best Of The Best

Do Not Rep+ Me For Helping

Rep+ If You Liked

Donate Here:
Any Donation Accepted

#9
@AZUMIKKEL Splits up the string (first parameter) with a character (second parameter) and puts it in an array
[Image: MaEIQ.png]

#10
Awesome
[Image: m9ljxv.jpg]



Possibly Related Threads…
Thread Author Replies Views Last Post
  New Project Mibbix 11 9,405 02-20-2013, 11:41
Last Post: Mibbix
  [Release] ZombieS Project - outdated - barata 9 8,872 01-03-2013, 03:26
Last Post: barata
  [News] Operation 'Let's start on another project that we won't finish' JariZ 10 8,695 08-26-2012, 17:59
Last Post: Arteq
Rainbow Preview Project Dark Night Nekochan 7 6,773 08-07-2012, 11:43
Last Post: Arteq
  [Release] Project Nova SparkyMcSparks 29 24,746 07-03-2012, 18:01
Last Post: Snipermats
  SnD bg sounds project paok-atak 8 6,817 05-22-2012, 18:08
Last Post: JariZ
  Project Anti cheat Joan 18 14,515 05-09-2012, 09:15
Last Post: GscGunner
  Real Science House 1 2,651 03-19-2012, 15:52
Last Post: Yamato
  Iron Wolf Project SuperNovaAO 8 7,917 02-07-2012, 00:58
Last Post: kokole
Bug Preview First photoshop project!(: skata3000 8 7,059 01-20-2012, 15:26
Last Post: Ic3coldh20

Forum Jump:


Users browsing this thread:
1 Guest(s)

Powered By MyBB, © 2002-2026 Melroy van den Berg.