Help - Search - Members - Calendar
Full Version: Prerequisites
SWR Productions Forum > Game Modding and Development > Generals/Zerohour Modding
3rdShockArmy
So, I've been messing around with the code a bit and after doing great for quite some time I hit a wall.

CODE
  Prerequisites
    Object = ChinaWarFactory
    Object = ChinaBreederReactor
    Science = SCIENCE_TacticalNukes SCIENCE_ICBMClearance
  End


I've been trying to give Russia and China the abiity to unlock each other's nukes. So I saw that object Prerequisites works fine when you put them next to each other, but the science just gets ignored. It only counts the first science Prerequisite.

Is there a way around this?
RedDeadSmeg
QUOTE (3rdShockArmy @ 6 Jul 2018, 14:53) *
So, I've been messing around with the code a bit and after doing great for quite some time I hit a wall.

CODE
  Prerequisites
    Object = ChinaWarFactory
    Object = ChinaBreederReactor
    Science = SCIENCE_TacticalNukes SCIENCE_ICBMClearance
  End


I've been trying to give Russia and China the abiity to unlock each other's nukes. So I saw that object Prerequisites works fine when you put them next to each other, but the science just gets ignored. It only counts the first science Prerequisite.

Is there a way around this?



I haven't tried it myself, but I'm interested to see if this is possible.

I'm guessing the only way this would work is with the 'or' logic, much like how some USA units can be built with either the Detention Centre or Drone Control Centre.
Whether this logic would work with Science I don't know.

If you managed to get it to work with both sciences granted, the next issue you would have is having to create a script where you would grant Russia with 'SCIENCE_TacticalNukes' (as it's a Chinese Science) and grant China 'SCIENCE_ICBMClearance' (as it's a Russian Science) as soon as the match begins. On Single Player missions it's very easy but on Skirmish I don't know how that would work.

I may experiment at some point, but if you have any results please let me know as I'd like to use this logic in a future mission wink.gif
3rdShockArmy
I did it already, but it doesn't work.

If I do it with objects it works. You don't need the "or" at all. You just place the objects next to each other:
CODE
  Prerequisites
    Object = ChinaWarFactory ChinaBreederReactor
  End


But if I do it with sciences, the second science gets ignored completely:
CODE
  Prerequisites
    Science = SCIENCE_TacticalNukes SCIENCE_ICBMClearance
  End


This also doesn't work. The second science gets ignored in this case as well:
CODE
  Prerequisites
    Science = SCIENCE_TacticalNukes or SCIENCE_ICBMClearance
  End


The same with this:
CODE
  Prerequisites
    Science = SCIENCE_TacticalNukes or Science = SCIENCE_ICBMClearance
  End


If I do this, the requirement is doubled, meaning I need both SCIENCE_TacticalNukes and SCIENCE_ICBMClearance, rendering the GP purchase useless and permanently blocking it's benefits:
CODE
  Prerequisites
    Science = SCIENCE_TacticalNukes
    Science = SCIENCE_ICBMClearance
  End
Zeke
"or" simply doesn't work for sciences it seems

perhaps you can just merge the 2 sciences into 1, and just give them different buttons
Shiro
But then you have the same description on the buttons IIRC.
3rdShockArmy
Thanks, Zeke! It's the closest thing to what I wanted, but unfortunately, as Shiro said, the tooltips are inseparable. It shows only one title and the description for both. I tried putting the "displayname" in command_buttons, but it crashes.
Zeke
You can just create a common name and description for both buttons then, if it doesn't bother you that much
3rdShockArmy
I did so. No, it doesn't bother me. In fact, I would have to change the tooltip anyway, because it would benefit both factions.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.