• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

SkiRich

First Lieutenant
76 Badges
Aug 27, 2017
232
25
  • Cities: Skylines Deluxe Edition
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Megacorp
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Ancient Relics
  • Crusader Kings II: Jade Dragon
  • Cities: Skylines - Parklife
  • Cities: Skylines - Parklife Pre-Order
  • Surviving Mars: Digital Deluxe Edition
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Hearts of Iron IV: Expansion Pass
  • Surviving Mars: First Colony Edition
  • Cities: Skylines - Green Cities
  • Hearts of Iron IV: Death or Dishonor
  • Surviving Mars
  • Europa Universalis IV: Mandate of Heaven
  • Cities: Skylines - Mass Transit
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Hearts of Iron IV: Together for Victory
  • Cities: Skylines Industries
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Golden Century
  • Surviving Mars: First Colony Edition
  • Cities: Skylines - Campus
  • Stellaris: Lithoids
  • Hearts of Iron IV: La Resistance
  • Stellaris: Federations
  • Crusader Kings III
  • Battle for Bosporus
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Victoria 3 Sign Up
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
Can someone please assist me in either finding the references or finishing this bit of code?

I am making a new crop. Its locked until utilitycrops tech is researched, but I also want to add a piece of code to say only unlock it if a specific mission sponsor is loaded.
I cant find any references in the environment to develop the if then statement for "IF MISSION SPONSOR = X" THEN UNLOCK.

function TechEffect:OnGameInit(city, tech)
LockCrop("Carrots", "UtilityCrops")
end

function TechEffect:OnResearchComplete(city, tech)
if tech.id == "UtilityCrops" then
UnlockCrop("Carrots", "UtilityCrops")
end
end
 
I did, thanks for asking. Posts on Steam were much faster to respond. It helps that I contribute quite a lot on those forums, so folks readily help me when I ask.

The code, if you are so inclined to view it can be seen built into the NASA Mission Sponsor available on the workshop.
I've learned so much more since then, and its all been community based with a bit of help from the devs from time to time.