Jump to content

Search the Community

Showing results for tags 'coding'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • 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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Skype


Yahoo


Discord


Origin


Steam


GOG.com


Xbox Live


PSN


Location


Interests


C&C:Online


CnCNet


XWIS


Renegade-X


W3D Hub


Favourite C&C

Found 1 result

  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?
×