IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Prerequisites, Some guidelines if possilble
3rdShockArmy
post 6 Jul 2018, 14:53
Post #1


Chat Nick
Group Icon

Group: Members
Posts: 845
Joined: 12 April 2015
From: Serbia
Member No.: 11096
If you ever decide to invade Russia, for the love of God, bring some warm clothes. We don't want you to blame the "evil Russian winter" when you get crushed, like everyone else who tried.



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?

This post has been edited by 3rdShockArmy: 6 Jul 2018, 14:56


--------------------
Oh Lord, have mercy, for I am unworthy!

Air war in Europe

Go to the top of the page
 
+Quote Post
RedDeadSmeg
post 6 Jul 2018, 17:05
Post #2



Group Icon

Group: Members
Posts: 190
Joined: 26 September 2016
From: England
Member No.: 13220



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
Go to the top of the page
 
+Quote Post
3rdShockArmy
post 6 Jul 2018, 18:34
Post #3


Chat Nick
Group Icon

Group: Members
Posts: 845
Joined: 12 April 2015
From: Serbia
Member No.: 11096
If you ever decide to invade Russia, for the love of God, bring some warm clothes. We don't want you to blame the "evil Russian winter" when you get crushed, like everyone else who tried.



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


--------------------
Oh Lord, have mercy, for I am unworthy!

Air war in Europe

Go to the top of the page
 
+Quote Post
Zeke
post 7 Jul 2018, 4:26
Post #4


The X General
Group Icon

Group: Project Leader
Posts: 2166
Joined: 7 June 2009
From: Philippines
Member No.: 73
Uniqueness is Overrated



"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

This post has been edited by Zeke: 7 Jul 2018, 4:30


--------------------
Go to the top of the page
 
+Quote Post
Shiro
post 7 Jul 2018, 12:50
Post #5


Gamer Girl
Group Icon

Group: Legend
Posts: 3808
Joined: 19 June 2009
From: Disboard
Member No.: 182
Friendly Freelancer



But then you have the same description on the buttons IIRC.
Go to the top of the page
 
+Quote Post
3rdShockArmy
post 7 Jul 2018, 18:53
Post #6


Chat Nick
Group Icon

Group: Members
Posts: 845
Joined: 12 April 2015
From: Serbia
Member No.: 11096
If you ever decide to invade Russia, for the love of God, bring some warm clothes. We don't want you to blame the "evil Russian winter" when you get crushed, like everyone else who tried.



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.


--------------------
Oh Lord, have mercy, for I am unworthy!

Air war in Europe

Go to the top of the page
 
+Quote Post
Zeke
post 8 Jul 2018, 6:37
Post #7


The X General
Group Icon

Group: Project Leader
Posts: 2166
Joined: 7 June 2009
From: Philippines
Member No.: 73
Uniqueness is Overrated



You can just create a common name and description for both buttons then, if it doesn't bother you that much


--------------------
Go to the top of the page
 
+Quote Post
3rdShockArmy
post 8 Jul 2018, 11:21
Post #8


Chat Nick
Group Icon

Group: Members
Posts: 845
Joined: 12 April 2015
From: Serbia
Member No.: 11096
If you ever decide to invade Russia, for the love of God, bring some warm clothes. We don't want you to blame the "evil Russian winter" when you get crushed, like everyone else who tried.



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.


--------------------
Oh Lord, have mercy, for I am unworthy!

Air war in Europe

Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 28 March 2024 - 10:17