Any hints on adding unit restrictions to a mission script?

Any hints on adding unit restrictions to a mission script?

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Any hints on adding unit restrictions to a mission script?

Post 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?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

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

Post by KDR_11k »

Startscripts can use the unit restriction feature of Spring.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

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

Post by hughperkins »

Super! Do you have an example?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

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

Post by KDR_11k »

Just start a game with restricted units and look in the script.txt?
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

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

Post 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.
Post Reply

Return to “Game Development”