Page 1 of 1

Victory Timer

Posted: Sat Sep 03, 2011 11:54 am
by Noobasaurus
Alright, I've read a tutorial about timers, it didn't work, so I want to make a timer that lasts 15 minutes and when it ends you get victory. It's probably really simple but not for me. :(

Re: Victory Timer

Posted: Sat Sep 03, 2011 11:58 am
by Tears2Roses
Under the instant action menu, there is a conquest then a timer button that you can set for 15 minutes. But if you always wanted a timer that lasts 15 minutes in your map that would be different. I could try the tutorials myself for a timer when I get around to it.

Re: Victory Timer

Posted: Sat Sep 03, 2011 11:59 am
by Noobasaurus
Tears2Roses wrote:But if you always wanted a timer that lasts 15 minutes in your map that would be different.
That's what I want.

Re: Victory Timer

Posted: Sun Sep 04, 2011 5:23 am
by DarthD.U.C.K.
try this(i havent tested it, maybe a bracket is missing)

Code: Select all

	 --Setup Timer-- 
    victory = CreateTimer("victory")
	SetTimerValue(victory, 900.0)

	-- ON FIRST SPAWN --
	onfirstspawn = OnCharacterSpawn(
        function(character)
            ReleaseCharacterSpawn(onfirstspawn)
            onfirstspawn = nil
            StartTimer(victory)
            OnTimerElapse(
				function(timer)
					MissionVictory(DEF)
					DestroyTimer(timer)
        		end,
			victory
        	)
        end
	)
its mostly from the mygeeto campaign. if you try to script something and dont know how to do it, you can always take a look at campaignscripts where something similiar happens.
and by the way: all tutorial work, if they dont, youve done something wrong.