The app won't call any Update function every frame? O rly?

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

Post Reply
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

The app won't call any Update function every frame? O rly?

Post by Ace_Azzameen_5 »

This code checks the CIS reinforcment count every 10 milliseconds. Just a work around I'd thought I'd post just in case no one else thought of it. . :roll:

--creates the EmergTroops_CIS timer
CreateTimer("EmergTroops_CIS")

SetTimerRate("EmergTroops_CIS", 100)

SetTimerValue("EmergTroops_CIS", 1)

--when a timer ends
OnTimerElapse(

function(post)

if GetReinforcementCount("2") == 9 then

SetReinforcementCount ("2", 10)

SetTimerValue("EmergTroops_CIS", 1)

StartTimer("EmergTroops_CIS")

end,

--the timer this OnTimerElapse() is 'connected' to
"EmergTroops_CIS"

--closes OnTimerElapse()
)

--start the EmergTroops_CIS timer
StartTimer("EmergTroops_CIS")
With this code
The CIS ticket count effectively never falls below ten, unless over 9 units are killed within the same 10 ms. Even units killed by the same grenade die further spaced out than that, right?

Thanks to Xwingguy and zerted for starting me off with coding.
Rekubot
Jedi
Jedi
Posts: 1080
Joined: Wed Apr 05, 2006 12:34 pm
Projects :: No Mod project currently.
Games I'm Playing :: Shadow Complex
xbox live or psn: Rekubot
Location: UK

RE: The app won

Post by Rekubot »

I don't really understand what we need this for. Does this make the CIS reinforcement count infinite or something?
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:

RE: The app won

Post by [RDH]Zerted »

SetReinforcementCount (2, -1) will set the 2nd team's reinforcement count to infinite.
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

RE: I fought The app and The app won

Post by Ace_Azzameen_5 »

Yeah, but the way and reason I have this set up this way is so that if you blow up enough droids, the unit count is significantly lowered, but they never run out.

It represents an infininite amount of security force droids stumbling upon the battle-and stops victory by conquest rules.
Last edited by Ace_Azzameen_5 on Sat Aug 12, 2006 9:04 am, edited 1 time in total.
sawyerdk9

RE: The app won

Post by sawyerdk9 »

Was this in the updated Rise of Empire 1 map? Because I was trying to beat it and when it got down to like 3 for the enemy reinforcements, it stopped dropping, even though I was killing the enemy.
Rekubot
Jedi
Jedi
Posts: 1080
Joined: Wed Apr 05, 2006 12:34 pm
Projects :: No Mod project currently.
Games I'm Playing :: Shadow Complex
xbox live or psn: Rekubot
Location: UK

RE: The app won

Post by Rekubot »

Wow Ace~, that's actually pretty useful. Thanks!
Post Reply