Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 8 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: String to function call
ZedX
General Member
Since: Mar 22, 2010
Posts: 12
Last: Sep 3, 2010
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Friday, Apr. 16, 2010 07:46 pm
Does the scripting engine allow this? Like eval()

I keep running into a Hunk_UserAlloc: out of memory with a function that I am guessing has way too many if() checks in it. Anymore than 24 and it throws the memory error. What is weird is that I was at one point able to load 27 prior to some model and FX additions. Eval() or similar I think would eliminate this problem. I can see no other wy around it.
Share |
DemonSeed
General Member
Since: Apr 30, 2009
Posts: 1362
Last: Feb 19, 2018
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Friday, Apr. 16, 2010 08:32 pm
I doubt the cause of the out of memory error is because you have too mang if() statements, but rather that your GSC size has exceeded its maximum size when compiled into fastfile given all the other stuff you have added (which is why after you've added certain stuff it is now suddenly chucking the error).

I had a similar hunk allocation error with my first mod for WaW which I got around by judicious saving of assets I compiled.

However, as to your question: there is no eval() function in the COD4 script function libary, but you can always use the switch() function on cases rather than use multiple if() statements.
Share |
ZedX
General Member
Since: Mar 22, 2010
Posts: 12
Last: Sep 3, 2010
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Friday, Apr. 16, 2010 09:33 pm
Yeah switch is no different from using if() in this case (I've tried that).

As for the compile, this is a loose gsc that isn't compiled into the mod.ff so that the end user can add and remove from it.

Even if I split it up into multiple functions with waits in between calls it tosses the error. The gsc itself is only 17k.

Meh, I'll figure something out eventually.
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»