Need help - Randomizing ship position and nav points relative to it

Post new mods and scenarios here.

Moderator: MOD_Command

Post Reply
Scorpion86
Posts: 262
Joined: Sun Feb 26, 2017 1:19 pm

Need help - Randomizing ship position and nav points relative to it

Post by Scorpion86 »

I am building a scenario that involves hunting a Soviet carrier group with restricted EMCON hiding among civilian traffic. It is my first scenario and I'm getting my first taste of using events, triggers, actions, and even dipping my toes in LUA. So I built my scenario with a ring of nav point 160nm wide around my Soviet SAG, all being relative to it, and once an enemy contact crossed it, the SAG would go unrestricted EMCON and launch escort fighters.

To improve replayability, I'd like to randomize the SAG's initial position. I tried doing that using the "Teleport" action, but as you can see, it would teleport the unit but not the nav-points. Is there any way to "teleport" the nav points along with the SAG?

I thought of teleporting the SAG using the action, then using a LUA script to generate the needed points around it. The problem then is that all the missions, triggers and actions that depends on those nav points will have to be redone in LUA, right?

I'm mainly asking if I'm on the right track or if there is another possibility I overlooked, rather then asking for bits of code that do what I asked. After all, figuring it out is half the fun! :P

Thanks in advance!

Image
Attachments
OhNoes.jpg
OhNoes.jpg (47.21 KiB) Viewed 80 times
Whicker
Posts: 664
Joined: Tue Jun 19, 2018 9:54 pm

RE: Need help - Randomizing ship position and nav points relative to it

Post by Whicker »

did you run game time forward at all? I think the ref points may move once time moves forward.

there is a thread in the lua forum about a random location script that a couple of us worked on.

It should not be that hard to do it all with lua, just takes some work. I made a starter scen that has a bunch of helper scripts built in, one was a way to create ref points around a unit I think. Look for Starter Scen as a topic in this forum I think. That also has the random ship location script built into it. Not sure about how to associate ref points with a trigger if they were created in lua, but I would think it is possible. that script allows you to name them however you want, I assume lua would allow you to create a trigger from a given table of ref points but not I'm not positive.
Scorpion86
Posts: 262
Joined: Sun Feb 26, 2017 1:19 pm

RE: Need help - Randomizing ship position and nav points relative to it

Post by Scorpion86 »

ORIGINAL: Whicker

did you run game time forward at all? I think the ref points may move once time moves forward.

Well now I feel silly.

It was just that: I ran the time forward and pop! The nav points snapped back around the Carrier Group. Thanks for the suggestions though, I'll take a look at them for inspiration when I try to randomize the commercial traffic!
Post Reply

Return to “Mods and Scenarios”