Jump to content

Recommended Posts

Posted

I need to set up triggers so that a random LUA script is run from a choice of four, and ONLY one is run. I got this from the Hoggit site (and yes this for a group, but I'm assuming I can do the same for script activation):

 

Single Choice from List

Once > Random 5% AND Flag 1 is False > Activate Group 1 AND Set Flag 1 True

Once > Random 5% AND Flag 1 is False > Activate Group 2 AND Set Flag 1 True

Once > Random 5% AND Flag 1 is False > Activate Group n AND Set Flag 1 True

 

Am I understanding correctly that there's a 5% chance the 1st Group will be activated, then 5% for the next and so on...until one is chosen down the list and sets the flag to true (this stopping any further activation)?

 

Now, since it's set up as "Once", there's a 95% chance nothing will happen each time. So since my list is rather short (only four scripts), there's a good chance that nothing will be run? Is there a way to make sure at least ONE is activated randomly and that's it?

 

I hope I'm making sense, I'm still new to triggers and mission building.

Posted

Okay, I think I've got an answer that works. If I use "Continuous Action" instead of "Once" it works the way I want. Are there any issues with having this run the entire mission? Performance problems? It still seems like a messy way to do it.

Posted

Either that or increase your chance of something spawning, like 50% instead of 5?

[sIGPIC][/sIGPIC]

 

Commodore 64 | MOS6510 | VIC-II | SID6581 | DD 1541 | KCS Power Cartridge | 64Kb | 32Kb external | Arcade Turbo

Posted

I considered that, but in that case there's a higher chance that the first scripts listed will be chosen first. I think. Math is hard. Anyway, I think this'll work. I'll let the mission play out for awhile and see what happens.

Posted

Yeah, there's only four triggers, and it's just me running it as an SP mission. I can't really release it to the public as it's quite a jumble of several other user's scripts crammed together to do what I want. And it's very, VERY messy. :D

Posted
Yeah, there's only four triggers, and it's just me running it as an SP mission. :D

 

tn_prnteye,

 

An open question, can you code? I mean, you have programming experience?

There are alternatives when it gets complicated.

 

FC

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Posted

Unfortunately, I cannot. I know enough to copy-pasta OTHER people's code, but that's about it. :D

 

Thanks for looking, though. I think my messy way works fine enough for me.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...