Generating Special events (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios



Message


StuartG -> Generating Special events (5/31/2017 4:25:31 PM)

Ive been looking through a few scenarios and noted that nobody yet seems to have yet been able to have a special event appear as an option at a special time. Looking at some of the changelogs this seems to have been added as an option, but ive never been able to make it work.

Basically what I want to be able to do is have an event create the special event as an option after a specific time. In this context, Washington giving general nuclear release, and the special event giving it to the units.

The reverse is also true, is there any way you can turn off an ordinary event from happening when you select a special event as an option? Ive generated nuclear release via a series of time generated actions, basically so I can use the side as AI or a playable one.

Apologies if these are daft questions and better asked elsewhere.




Dan109 -> RE: Generating Special events (5/31/2017 5:52:10 PM)

Just to make sure we're on the same page, a special event is a manual trigger executed by the human player only. However you want some other event to 'allow' the use of that special event? You can't create the special event, but you can control its use with a global variable. Set that global var to true in the regular event, and if/when the player tries to execute the special event, the first thing you should check is that global var. if false or nil (best practice would be to define it globally at scenario start and set to false), then skip rest of code and return with a population stating why they can't run the spec event yet. If true, carry on....




Dan109 -> RE: Generating Special events (5/31/2017 6:02:29 PM)

Oh, about your reverse situation, yes you can. Same concept above, using a global varaiable. Say stop_reg_event=true is set in your special event (and remember to set to false at scenario start), you can set up a conditional on your event to check the flag. If not(stop_reg_event) then do_reg_event else explain_why. I haven't actually used a conditional, so I have no idea if it needs to be a function to return true/false or whatever but you can put this described logical check in your action code, and it would do the same thing.




StuartG -> RE: Generating Special events (5/31/2017 6:04:11 PM)

Ive probably made a muddle explaining myself. Basically I want the player to be able to select a special action from the list (in this case, use nuclear weapons). But I dont want the option to even appear in the list at all before a certain point, in this case a triggering event that is created by a timer. Is that even possible? And if so, what is the LUA code to make something like that happen?

As for the rest, Ive set it so that an event (I basically set about 5 different events, each with a different random time and a percentage chance of it triggering) to alter the sides nuclear posture. That is so if that side is played by the computer, you still have a chance of nuclear weapons being triggered via the other side and surprising you. I want to leave that in place, so you have a chance of it happening over your head (whereby you wont get the points loss) but that if I DO select the Speical event trigger, it will then remove these events so it doesnt create a confusing event.

I guess what im saying is, I want my cake and eat it. :D And probably a horribly over complicated way of doing it. The problem is, if I did it via special event alone, I wouldnt have the enemy select the option at all when playing against me.

Basically it sounds as if Im going to have to use variables. Oh dear, I can feel my brain suffering from the China syndrome already....




Rory Noonan -> RE: Generating Special events (5/31/2017 9:23:01 PM)

No need for keyvalues or anything else fancy here.

If you create the special action and leave it 'inactive' it won't be visible to the player. Then use whatever triggers you like for a new event that sets the special event to active. Now it's visible to the player.

Should be two or three lines of simple code at the most.

If you need help doing this post a save file and I'll give you a step-by-step.




StuartG -> RE: Generating Special events (6/1/2017 4:09:41 PM)

Hmm, thats a good idea. I wont have time to try it till this weekend, but Ill give it a go. Ill ask if I have any further problems.

Thanks for the suggestion.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
1.132813