So I have this conquest map with two local teams, one friendly to ATT the other to DEF. I'm trying to set it up to where the team friendly to ATT only spawns if ATT's reinforcement's are below DEF's and if DEF's reinforcements are above 30. Vise Versa applies to the local's friend to DEF.
LUA seems like witchcraft to me, so I am hoping one of you guys might have advice.
controlling team spawn
Moderator: Moderators
-
ZoomV
- Rebel Warrant Officer

- Posts: 308
- Joined: Thu Aug 15, 2013 11:27 am
- Projects :: Old Republic Map pack
- xbox live or psn: No gamertag set
- Location: Belsavis, Maximum Security Ward
-
AQT
- Gametoast Staff

- Posts: 4910
- Joined: Sat Nov 03, 2007 4:55 pm
- Location: SoCal, USA
Re: controlling team spawn
Here's a very similar code that you can use as a base: http://www.gametoast.com/viewtopic.php?p=328409#p328409
-
ZoomV
- Rebel Warrant Officer

- Posts: 308
- Joined: Thu Aug 15, 2013 11:27 am
- Projects :: Old Republic Map pack
- xbox live or psn: No gamertag set
- Location: Belsavis, Maximum Security Ward
Re: controlling team spawn
<_<AQT wrote:Here's a very similar code that you can use as a base: http://www.gametoast.com/viewtopic.php?p=328409#p328409
>_>
huh, I completely blanked on there being a GetReinforcementCount call. I was trying to do something crazy with OnTicketCountChange.
Anyways, is there a way to print a message in the log so I can have it tell me when it does its thing, and what syntax would be necessary to get said log message also print the reinforcements at that point?
-
Marth8880
- Resistance Leader
- Posts: 5042
- Joined: Tue Feb 09, 2010 8:43 pm
- Projects :: DI2 + Psychosis
- xbox live or psn: Marth8880
- Location: Edinburgh, UK
- Contact:
Re: controlling team spawn
Sure. The function you're looking for is print(). Here's its usage:ZoomV wrote:Anyways, is there a way to print a message in the log so I can have it tell me when it does its thing, and what syntax would be necessary to get said log message also print the reinforcements at that point?
Code: Select all
i = "Hello World!";
print(i); -- prints "Hello World!" (without quotes)Code: Select all
i = "Hello World!";
print("Message: "..i); -- prints "Message: Hello World!" (without quotes)Code: Select all
local screenWidth, screenHeight = ScriptCB_GetScreenInfo()
local aspectRatio = screenWidth / screenHeight
print("ME5_MiscFunctions: Width: "..screenWidth.." Height: "..screenHeight.." Aspect Ratio: "..aspectRatio)In your case, you'd want to assign the result of GetReinforcementCount to a variable, and then print that variable (possibly with a message for organization/clarity reasons).
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: controlling team spawn
Don't use concatenate, use commas instead. If you try to concatenate a nil value it'll crash. It doesn't crash if you use commas.
Examples:In Lua you can use ' or " for string (but not both at the same time: 'this is wrong").
Examples:
Code: Select all
print('Team: ', DEF, 'count:', GetReinforcementCount(DEF))
local impCount = GetReinforcementCount(IMP)
print('Team:', IMP, 'count:', impCount)