Jump to content

Search the Community

Showing results for tags 'lua'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • News & Updates
    • Command & Conquer News
    • Site / Forum News & Discussion
  • General Discussion Forums
    • Off-Topic Discussion
    • Gaming Discussion
    • Tech Discussion & Support
  • Command & Conquer Universe of Games
    • Command & Conquer: General Discussion
    • Command & Conquer: Remastered Collection
    • Rivals
    • The Ultimate Collection / The First Decade
    • Tiberium Alliances
    • Tiberian Twilight
    • Red Alert 3 / Uprising
    • Tiberium Wars / Kane's Wrath
    • Generals / Zero Hour
    • Renegade
    • Red Alert 2 / Yuri's Revenge
    • Tiberian Sun / Firestorm
    • Red Alert / Counterstrike / Aftermath
    • Command & Conquer / Covert Operations
  • Battle for Middle-earth Universe of Games
    • Battle for Middle-earth II / Rise of the Witch-king
    • Battle for Middle-earth
  • Dune Universe of Games
    • Emperor: Battle for Dune
    • Dune 2000
    • Dune II
  • Hosted Projects
    • Command & Patch
  • The Archives
    • Cartoon and Conquer
    • Command & Conquer Legos / Tiberium Legos
    • Renegade-X
    • TibEd.Net Forums
    • C&C 2013 [Cancelled Game]
    • TIBERIUM [Cancelled Game]
    • Tiberium Chronicles RPG Project [Archived Project]
    • YR: Generals Mod [Archived Project]
    • Petro-Gamers Archive

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL







Xbox Live








W3D Hub

Favourite C&C

Found 3 results

  1. I was trying to keep track of some status in gameplay and react as soon as certain condition's met, and I've written some code similar to that below. -- function to run on a unit of this type created function KeepTrackAndReactOnCreated(self) if unitCnt == nil then unitCnt = {} -- global variable end local plyr = ObjectTeamName(self) if unitCnt[plyr] == nil then unitCnt[plyr] = 1 else unitCnt[plyr] = unitCnt[plyr] + 1 end if unitCnt[plyr] >= 5 then ObjectGrantUpgrade(self, "Upgrade_SomeUpgrade") end end -- function to run on a unit of this type destroyed function KeepTrackAndReactOnDestroyed(self) local plyr = ObjectTeamName(self) unitCnt[plyr] = unitCnt[plyr] - 1 if unitCnt[plyr] < 5 then ObjectRemoveUpgrade(self, "Upgrade_SomeUpgrade") end end It's working just fine, until I saved the game and then loaded it...It seems that every time I load the SavedGame file, unitCnt doesn't exist, as if the global variable and its value were not saved to the SavedGame file. Does anyone has any idea of how I can solve this problem? Is there any way to save a global variable and its value to a SavedGame file and have them loaded later? Or is it just impossible to do so?
  2. I'm working on MetaMod_2.00 by Mjjstra, and I want to create a tower defense map using lua. And I have to evaluate whether timer equal to a specific value to excute some actions .I have found the lua function to judge whether timer equals to a spcific value like this function TimerCounterRefresh(self) for counter,value in TimerTable do if counter~="n" then if value == 0 then ExecuteAction("HIDE_COUNTER", counter) --tremove(TimerTable, counter) TimerTable[counter] = nil NumberTimers = NumberTimers - 1 if NumberTimers <= 0 then ExecuteAction("NAMED_DELETE", self) end break elseif value == 1201 then ExecuteAction("PLAY_SOUND_EFFECT", VoiceTimerMin[20]) elseif value == 901 then ExecuteAction("PLAY_SOUND_EFFECT", VoiceTimerMin[15]) elseif value == 601 then ExecuteAction("PLAY_SOUND_EFFECT", VoiceTimerMin[10]) elseif value == 301 then ExecuteAction("PLAY_SOUND_EFFECT", VoiceTimerMin[5]) elseif value == 181 then ExecuteAction("PLAY_SOUND_EFFECT", VoiceTimerMin[3]) elseif value == 61 then ExecuteAction("PLAY_SOUND_EFFECT", VoiceTimerMin[1]) elseif value == 31 then ExecuteAction("PLAY_SOUND_EFFECT", VoiceTimerSec[30]) elseif value == 11 then ExecuteAction("PLAY_SOUND_EFFECT", VoiceTimerSec[10]) elseif value == 4 then ExecuteAction("PLAY_SOUND_EFFECT", VoiceTimerCount[3]) elseif value == 3 then ExecuteAction("PLAY_SOUND_EFFECT", VoiceTimerCount[2]) elseif value == 2 then ExecuteAction("PLAY_SOUND_EFFECT", VoiceTimerCount[1]) end ExecuteAction("COUNTER_MATH_COUNTER", counter, MathOpTable["Subtract"], CounterTable[1]) TimerTable[counter] = TimerTable[counter] - 1 end end end But I can't figure out how to execute the function every second in the game loop to .Can someone help me?
  3. I'm trying to set SpecialPower's countdown timer backward in game, with LUA code: ExecuteAction("NAMED_SET_SPECIAL_POWER_COUNTDOWN", self, "SpecialPowerGDI_APCMinefield", 10); it works fine with UnitAbility like APCMinefield, but doesn't affect PlayerSpecialPower like Ioncannon, nuke, etc. i guess it may has something to do with GDIPowerStore and/or PlayerSpellBook so i applied the same codes ---SpecialPower XMLs, and LUA scripts --- to them too, still not working. any ideas?