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?
Any hints on adding unit restrictions to a mission script?
Moderator: Moderators
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Re: Any hints on adding unit restrictions to a mission script?
Startscripts can use the unit restriction feature of Spring.
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Re: Any hints on adding unit restrictions to a mission script?
Super! Do you have an example?
Re: Any hints on adding unit restrictions to a mission script?
Just start a game with restricted units and look in the script.txt?
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Re: Any hints on adding unit restrictions to a mission script?
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.
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.
