SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH4 Mods Workshop > SH4 Mission Designers' Forum
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 03-09-18, 07:41 PM   #1
Imarider
Mate
 
Join Date: Aug 2017
Posts: 51
Downloads: 98
Uploads: 0
Default If unit destroyed

If i have some unit in campaign in one of the .mis files (UKHarbourTraffic.mis in OM for example) and it's destroyed and i make the event with trigger to spawn this unit (destroyer), i mean if i kill the Destroyer and make this event, it will be spawned immediately, in this patrol, or in next patrol? I want that it spawn in next patrol, will it work? Or just the game load this .mis file in next patrol with the same ships that added to this .mis file in editor? If i can't to spawn destroyed unit in next patrol (not in the same when it's destroyed) this way, is there are possible to do it another way or what i have to do else? At least this will not cause CTD?

Last edited by Imarider; 03-09-18 at 11:14 PM.
Imarider is offline   Reply With Quote
Old 03-10-18, 09:07 AM   #2
propbeanie
CTD - it's not just a job
 
propbeanie's Avatar
 
Join Date: May 2016
Location: One hour from Music City USA!
Posts: 9,719
Downloads: 439
Uploads: 2


Default

If you open that particular file in a text editor, you'll see lines like "DelayMin=1", "DelayMinInterv=8635" and "SpawnProbability=70". This particular example from one of my files means that the RGG (Random Generated Group) will spawn with a one minute delay every eight thousand six hundred thirty-five minutes, but at a seventy percent rate, or 7 in 10 times. In SH4MissionEditor, you do not see that "DelayMin=1" setting, and the "DelayMinInterv=8635" is actually listed in hours, or 143.91666_ hours, in this case. Further down in the text will be something similar to "MaxInst=50", which means, for this particular example, that the RGG will generate 50 time maximum in this cycle (file lifetime), irrelevant of the other three settings above. If it hits 50 prior to the end of the file cycle, it quits generating the RGG. There is also a "MaxUnitsCreated=20" setting, which means that each spawning of the RGG can have a maximum of 20 ships. You'll see "default" values for those for 10000 and 100 in the stock game. Most would be on the order of 100 and 1. They all work together though, for when to spawn the RGG (Random Generated Groups).

In other words, if an RGG is set to spawn more than once ("MaxInst=" line), and you've destroyed the one in-game at this time, when the next spawn cycle comes due (the "DelayMinInterv=" line), then it will spawn another vessel in that same spot. By the same token (and lurker worked very hard on this portion of his mods), if the spawn rate is set too high, and the game attempts to generate another "new" unit where the first is, you will often end up with overlapping spawned units, which can look very strange, sometimes resulting in explosions and fires, when the ships' collision detection kicks in...
__________________

"...and bollocks to the naysayer/s" - Jimbuna
propbeanie is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 12:08 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 1995- 2024 Subsim®
"Subsim" is a registered trademark, all rights reserved.