Logo Platform
logo amplifiers simplified

Issue with setting prerequisite...

Reply
Copied to clipboard!
8 years ago
May 17, 2017, 5:50:28 AM

I'm trying to restrict the use of a slot on a ship based on the level of the ship. In other words, in this example, I want to allow the player to see and use this slot if the ship is level 2 or higher.


<Slot Name="Support03" ShowPositionMarker="true" PositionMarkerAngle="45">

                      <InterpreterPrerequisite Flags="Prerequisite,Discard">(Property(Context, @'../ClassEmpire/ClassGarrison/ClassShip', Level) ge 2)</InterpreterPrerequisite>

                      <RestrictedModuleCategory>Support</RestrictedModuleCategory>

                      <Direction X="0" Z="1"/>

                      <UISlotName>UICoreWeapon09</UISlotName>

</Slot>


When I use the above code, I get the following result (ship with no slots):



What am I missing?


0Send private message
8 years ago
May 17, 2017, 8:38:39 AM

Hello Knyghtefall,

I think your problem is that you're trying to check something that doesn't exist and it breaks things in the game ^^

Ship designs are abstract and are just blueprints for ships, thus they don't have levels. What would happen if you had 3 Raider but one was level 1, the other was level 2 and the last one level3?

If I have a minute today,  I can try applying your XML to my local version and tell you what error message it returns, if it may help you.

 

Cheers,

 

0Send private message
8 years ago
May 17, 2017, 5:20:57 PM

Hi 'Caffeine,


What you're saying makes sense. I was hoping to do is something like this:


1) Player builds a ship

2) Player levels his ship a couple of times and decides to edit *that* ship

3) Player doubleclicks the ship to edit it, bringing it into the ShipDesigner

3) In the ShipDesigner, it recognizes that the ship is now level 3 and a new slot is now available. 


I was looking to reward the player for keeping his ship alive to a higher level, which results in newer and better ship capabilities. 


So, I guess the question is, how do I apply the prerequisite to the ship and not the ship design?



Updated 8 years ago.
0Send private message
8 years ago
May 19, 2017, 10:25:24 AM

Unfortunately I don't think this is something you can do purely in XML.

You issue is that you're trying to edit an individual ship's design while the system is built around editing a blueprint for all ships built from this blueprint.

What you want to do requires some work you can't do in XML (nor in C# since users can't touch the game's code)


Sorry :/

Updated 8 years ago.
0Send private message
8 years ago
May 20, 2017, 10:34:51 AM

I hear what you're saying. When you double click on a ship and change it's config, how does the game apply that? It seems to clone the existing config and then modify it. I wonder if there is some interim configuration that it applies?

0Send private message
8 years ago
May 22, 2017, 9:19:43 AM

If you double click on a ship to change its design two things may happen:

Either your ship is rocking the latest design and you will be able to edit the design (blueprint) to a new revision

Or your ship is still on an old revision of the design and it will be opened in a Read-Only mode that reads the ship configuration without letting you edit it (but will give you a button to edit the latest version fo the design)


In any case, you will end up editing the blueprint's latest version and never a ship itself.


0Send private message
0Send private message
8 years ago
May 23, 2017, 2:26:07 PM

Hero ships are special cases and even though heroes of the same class share the same hull, their designs are independant. However I don't know the details of how this is handled :/


0Send private message
8 years ago
May 23, 2017, 2:40:32 PM

Even with hero ship you modify a BP, what you want looks like the tech that unlock slot for a model in fact.


Something like that can be tweaked by XML ?

0Send private message
8 years ago
May 23, 2017, 6:21:15 PM

Yeah, I'm trying to think of a way to validate a tech/descriptor once a ship has hit a certain level, but I can't get at the live ship, just the blueprint for the ship.

0Send private message
8 years ago
May 23, 2017, 6:31:23 PM

'Caffeine, how about this...is there any way to mod the "Group_ApplyShipExperienceBonus" ? It would make sense to attach any experience event to that.

0Send private message
8 years ago
May 24, 2017, 8:23:05 AM

There's only so much you can do in XML - I think this sort of stuff would require some code work to be done properly.

However, I'm not very familiar with the aspects of the XML you're trying to mod so I could be wrong.

0Send private message
7 years ago
May 30, 2017, 5:06:47 AM

Late reply, but you may want to look into the SimulationDescriptors, particularly something like SimulationDescriptors[EmpireImprovements].xml.  Look down towards the file about half way, that's where a lot of the "Stage" (level) stuff is handled I believe, you may be able to do something out of that.

0Send private message
7 years ago
May 30, 2017, 6:31:39 PM

Agreed, but the problem is that I want it to occur for the individual ship, not all ships, if that makes sense. In other words, when you create an Empire Improvement, then every ship built that checks for that prerequisite from that point forward will have it flagged as true. 


What I'm trying to do is check for a prerequisite based on a property of the ship. I've got some ideas on how to do it, I just need a hunk of time to test out my theories (and maybe learn how to do quests).





0Send private message
?

Click here to login

Reply
Comment