Race Mode .lua coding (Now working!)

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Post by Maveritchell »

I think part of my problem was that I wasn't activating the regions in the .lua. By doing that, I was at least able to get this error to show up in the BF2log (no doubt this would repeat for racer2laps, racer3... etc.):

Code: Select all

Message Severity: 3
.\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to perform arithmetic on global `racer1laps' (a nil value)
stack traceback:
	(none): in function <(none):951>
Not sure what that means; I even tried setting up a region to define them on the start of the level (even though you said that wasn't necessary), with the same results.
Ace_Azzameen_5
Jedi
Jedi
Posts: 1119
Joined: Sat Apr 23, 2005 8:52 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by Ace_Azzameen_5 »

racer1laps hasn't been given a number value yet when you try and add to it. Thats my best guess.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Post by Maveritchell »

Yeah, that's what I figured. But like I said, I even tried creating a region that set a value of zero for all my undefined variables, and I still got the same error.
Ace_Azzameen_5
Jedi
Jedi
Posts: 1119
Joined: Sat Apr 23, 2005 8:52 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by Ace_Azzameen_5 »

Wait? Did you try the setting to zero without the region?

You should do what I said above and make sure all the regions are triggering.
Edit: I've made way to many posts in this thread-xfire: gtaceazzameen5
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Post by [RDH]Zerted »

Please excuse my lack of help, I am in the middle of moving (I don't even have a bed to sleep on :(). I should have my computer back and running around the start of next week, but I will be on dial-up till Sept. I've skimmed the lastest posts, but don't have the time to write up anything else at the moment. I don't know how much computer time I will have during the next 6 days.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Post by Maveritchell »

Image

It's working, IT'S WORKING!!

Yep, thanks to a lot of help from Ace_Azzameen_5, I got race mode working. It turns out that "player" is a numerical value, not a string value. I still need to do some multiplayer checks and work on some more AI issues in the map, but race mode is now a definite "go."
Post Reply