Scar Help -1 reply

Please wait...

iDeekz

Sniper Regiment

50 XP

15th February 2008

0 Uploads

1,052 Posts

0 Threads

#1 11 years ago

Hello. I'm in need of help. I've looked about on the Relic forums but i cannot seem to find what i'm looking for. Basically, I need the code for a timer to countdown, and it must display on the screen. And, there is one more thing. I need to know how i can continue spawning troops at different times, and have different infantry and vehicles. Thanks, Icespeed.




Sgt. D. Pilla

Uber Geek

50 XP

23rd October 2007

0 Uploads

3,473 Posts

0 Threads

#2 11 years ago

Didn't Lethal Dosage or $_Texas_$ help you with this? And even provide the Scar for you?!




iDeekz

Sniper Regiment

50 XP

15th February 2008

0 Uploads

1,052 Posts

0 Threads

#3 11 years ago

Yeah, texas did. But i changed the whole code about to what i need for my mission. As i said i need a timer that "Countsdown" and displays on the screen. And i know how to make troops spawn but i don't know how to make different troops spawn after the other troops spawn. Help please, ive looked everywere.




Sgt. D. Pilla

Uber Geek

50 XP

23rd October 2007

0 Uploads

3,473 Posts

0 Threads

#4 11 years ago

... So you created yet another thread, for the same script...Why don't you just use the same thread?! and bump it up each time you have trouble...?




iDeekz

Sniper Regiment

50 XP

15th February 2008

0 Uploads

1,052 Posts

0 Threads

#5 11 years ago

The code isn't the same. Plus, this forum is like 1% active and they wont return back to the same thread.




$_TEXAS_$

Don't Mess with Texas

50 XP

5th September 2007

0 Uploads

195 Posts

0 Threads

#6 11 years ago

People will return to threads as long as they are active, and you can revive threads just by adding a new post to it. for your questions, the timer just needs a little bit of code: two function needed function UITimerInit() Timer_Start("Timer", 65) end function UITimer() Timer_DisplayOnScreen("Timer") end the calls: UITimerInit() Rule_AddInterval(UITimer, 1) one creates the timer (in this case for 65 sec) and the other keeps it displayed to the screen. Will be located just above the minimap in game. The reinf function I showed you can be copied and added to to do what ever you want use "Rule_AddInterval(function_name, time)" to call in units over certain time periods, just change "time" to the interval between arival. you can have ass many "Util_CreateSquads" calls in the reinf function to call in multi units at one time, you can use "luaconsts.scar" to get the names for almost all units in the game. these are a few examples of unit calles for each army: SBP.AXIS.OFFICER SBP.ELITE.FALLSCHIRMJAGER SBP.ALLIES.SHERMAN SBP.CW.CHURCHILL_CROC in your example on your privios thread (this is why you shouldn't start a new thread, so others can reference) change the "SBP.ALLIES.RIFLEMEN" in the "Util_CreateSquads" to any new unit. study these examples and try to experiment on an open test map, it is better to learn most of this rather than get help for everything, you will learn better. However somethings are hard to learn and if you have more scar questions just add them to this thread.




Sgt. D. Pilla

Uber Geek

50 XP

23rd October 2007

0 Uploads

3,473 Posts

0 Threads

#7 11 years ago

*Finds other threads* .... ... .. . But YES! I finally learn't a bit of SCAR! Wow, its really not that hard lol I wonder if my mod could use a timer for anything...*Finds COH Scar Tutorials for Game Time*

@Icespeed A little bit of googling would have helped heaps.. ScarDoc - Scar Documentation




iDeekz

Sniper Regiment

50 XP

15th February 2008

0 Uploads

1,052 Posts

0 Threads

#8 11 years ago

Thank you. Are you going on msn?




iDeekz

Sniper Regiment

50 XP

15th February 2008

0 Uploads

1,052 Posts

0 Threads

#9 11 years ago

Well i did what you said, but i don't exactly know the exact location of were to place the code. As you can see i've placed it before everything else but it still doesn't display. The reason why I did this was so it would start the timer as soon as you started the game. But, it hasn't done that, its skipped the timer and moved on to my other part of the code.

import("ScarUtil.scar") function OnGameSetup() player1 = World_GetPlayerAt(1) player2 = World_GetPlayerAt(2) end function OnInit() function UITimerInit() Timer_Start("Timer", 65) end function UITimer() Timer_DisplayOnScreen("Timer") end



$_TEXAS_$

Don't Mess with Texas

50 XP

5th September 2007

0 Uploads

195 Posts

0 Threads

#10 11 years ago

You have one of the functions defined in the "main" and no calls to the functions, code for the timer should look something like this: import("ScarUtil.scar")

function OnGameSetup() player1 = World_GetPlayerAt(1) player2 = World_GetPlayerAt(2) end

function OnInit()

UITimerInit() Rule_AddInterval(UITimer, 1)

end

Scar_AddInit(OnInit)

function UITimerInit() Timer_Start("Timer", 65) end function UITimer() Timer_DisplayOnScreen("Timer") end