"If ____ is ____, then _____ happens"

Moderators: Dandin384, Kushan, ckfinite

"If ____ is ____, then _____ happens"

Postby Coiler12 » Sat Dec 20, 2014 2:05 am

How would you use Lua to make "If then else" (if that's the right phrase) situations in Command, so you don't have to use scoring workarounds anymore?

Example:
-You control the SEAD element.
-Friendly computer side has a strike programmed to launch if enough enemy air defenses have been taken out.
-In 1.05 and below, you'd have to set a scoring system for a non-playable side (one AAA site destroyed equals 1 point, once it reaches a certain number, the activate strike mission fires).

I might be too vague, so don't hestitate to let me know if you need a specific situation to answer the question.
Coiler12
 
Posts: 45
Joined: Thu Oct 02, 2014 11:11 pm

Re: "If ____ is ____, then _____ happens"

Postby ckfinite » Sat Dec 20, 2014 3:12 am

Exactly the same way, just a bit nicer.

What you'll do is use something like my persister library or the KeyValue mechanism, then increment a variable to represent the # of AA systems killed. Then, once that's reached a certain value, assign the mission.
ckfinite
 
Posts: 30
Joined: Tue Oct 28, 2014 4:21 pm



Return to Command Lua




Users browsing this forum: No registered users and 0 guests

cron