Page 1 of 1

Any hints on adding unit restrictions to a mission script?

Posted: 03 Nov 2008, 07:34
by hughperkins
Any hints on adding unit restrictions to a mission script?

Obviously a mod itself can define exactly which units can/cant be built, but ... how easy is it to define this in a mission script?

I guess, off the top of my head, one way to do this could be to create a mod for each mission, which then references some core mod. The mission-script mod will then set all units as unbuildable except those that are required for that particular mission?

Re: Any hints on adding unit restrictions to a mission script?

Posted: 03 Nov 2008, 10:01
by KDR_11k
Startscripts can use the unit restriction feature of Spring.

Re: Any hints on adding unit restrictions to a mission script?

Posted: 03 Nov 2008, 10:07
by hughperkins
Super! Do you have an example?

Re: Any hints on adding unit restrictions to a mission script?

Posted: 03 Nov 2008, 10:10
by KDR_11k
Just start a game with restricted units and look in the script.txt?

Re: Any hints on adding unit restrictions to a mission script?

Posted: 03 Nov 2008, 14:11
by hughperkins
Ah.... hmmm.... ok. I hadn't realized that you meant the start.txt script (lua scripts are in a "startscripts" folder, but that's something different).

Whilst that's cool in that it does give a way forward, some way of applying restrictions from within a lua script itself would make missions more self-contained, and easier for people to use.