SUBSIM Radio Room Forums



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

Go Back   SUBSIM Radio Room Forums > Modern-Era Subsims > Dangerous Waters > DW Mod Workshop > DW Mission Designers' Forum
Forget password? Reset here

Reply
 
Thread Tools Search this Thread Display Modes
Old 09-23-16, 12:34 AM   #1
rentacow
Machinist's Mate
 
Join Date: Sep 2014
Location: Onakushcloud
Posts: 125
Downloads: 55
Uploads: 0
Default Help scripting a sequence of events. (Solved!)

Hello everyone! I have good news and bad. The good news is that I'm working on a few new missions. The bad news is that the editor has shot down almost every good idea I've tried to implement so far. Things like having AI vessels dropping cargo overboard when triggered by the player, are utterly impossible as far as I can tell. Further, scripting sequences of events is a complete nightmare!

So here is what I'm trying to do:
Stage 1:
Ship A (player) approaches Ship B (AI)
Ship B runs away at flank speed at the first sight of Ship A
Stage 2:
After a few minutes Ship B has engine trouble and comes to a stop
Ship A receives orders to position a helo within a few hundred yards of Ship B for 5 to 10 minutes.
Stage 3:
Once the player does this, Ship A gets orders to recover the helo.

Right now I have the key units down and some triggers and scripts for stage 1 and 2 only. The way I have tried to do it is causing the game to crash just a few seconds after stage 1

Here is the mission file so you can see for yourself. Let the mission run for about 10 minutes, it should crash right after the first radio message is received. Using truth, watch the behavior of the small neutral boat also.

EDIT: Fixed! https://www.dropbox.com/s/5y3pss27jn...rt%201.mu?dl=0

Last edited by rentacow; 09-23-16 at 12:28 PM.
rentacow is offline   Reply With Quote
Old 09-23-16, 04:03 AM   #2
Micksp
Sailor man
 
Join Date: Apr 2002
Location: Burgas, Bulgaria
Posts: 50
Downloads: 31
Uploads: 0
Default

I'll try to help you with the scripting after 10-12 hrs when I'm back home, but need to have the DW running. It was a problem I have described here couple of months ago. I'll try with different installation pakage, so let's hope..
Micksp is offline   Reply With Quote
Old 09-23-16, 04:06 AM   #3
Micksp
Sailor man
 
Join Date: Apr 2002
Location: Burgas, Bulgaria
Posts: 50
Downloads: 31
Uploads: 0
Default

According the 3: I can't remember, but I think the AI (not player controlled) units caused troubles with the triggers. In that order not sure tha thask for the Hello is possible.
Micksp is offline   Reply With Quote
Old 09-23-16, 04:38 AM   #4
Micksp
Sailor man
 
Join Date: Apr 2002
Location: Burgas, Bulgaria
Posts: 50
Downloads: 31
Uploads: 0
Default

Got it working in the office. Have your file dounloaded and will take a look..
Micksp is offline   Reply With Quote
Old 09-23-16, 05:59 AM   #5
Micksp
Sailor man
 
Join Date: Apr 2002
Location: Burgas, Bulgaria
Posts: 50
Downloads: 31
Uploads: 0
Default

Just opened the mission in the editor for a quick review. Noticed you made the helo player controlled, not realy sure in that order the helo can execute the orders. I prefere to leave it as inflight aircraf and then give him orders to move at specified possition. Also, it is a good idea to add some randomness to the both starting locations and do not give to shortes ranges in the triggers. Ill try to write it later, if you wish, find me on the Facebook: Mick First.

Best regards!
Micksp is offline   Reply With Quote
Old 09-23-16, 09:52 AM   #6
rentacow
Machinist's Mate
 
Join Date: Sep 2014
Location: Onakushcloud
Posts: 125
Downloads: 55
Uploads: 0
Default

Ok thanks for the help. I really should remove the in-flight helo and see if the mission still crashes.

Everything is so close together because it is for testing. I must get everything working before I move the units to their final positions and add randomness.

EDIT: I might have found the solution. It seems that triggers and scripts may not have the same name. Stage 2 of the sequence starts correctly now... except it seems 0.01% fuel is all that small speedboat needs to cross the Atlantic! :O

Last edited by rentacow; 09-23-16 at 12:28 PM.
rentacow is offline   Reply With Quote
Old 09-23-16, 12:27 PM   #7
rentacow
Machinist's Mate
 
Join Date: Sep 2014
Location: Onakushcloud
Posts: 125
Downloads: 55
Uploads: 0
Default

Well I had too much coffee and finished the whole sequence of events. I'm going to add more objectives and dynamic starting locations for all the key units before I call this a mission. For now it is simply a proof of concept for testing purposes. Notice how the helo is able to deploy rescue swimmers and save everyone in only 2 minutes. I do hope it's not too confusing to understand as I didn't leave much comments as clues to what everything does.

Anyway, enjoy picking through it and hopefully it might even help someone out!


https://www.dropbox.com/s/5y3pss27jn...rt%201.mu?dl=0

text only:
 

VERSION 3
OWNALLIANCE 0
DIFFICULTY 1
TOTALNUMSIDES 1
NUMDRIVEABLES 2
MONTH 4
WORLDGRID 2
LATLONG 26.072357 -79.690170
;
SEASTATE 1
MDR 0 0 0
BOTTOMTYPE 2
TIMEOFDAY 0
WEATHER 0
CLOUDHEIGHT 4500
SSP 0
MISSIONTITLE
BEGINTEXT
Miami Vice Part One
ENDTEXT




ENTITY 1995 SURFENTITY
HULLID 2
ALLIANCE 0
POS 538395.437500 506432.375000 0
POINTS 750
COURSE 7
SPEED 9
PROB 100
DRIVEABLE 1
UNIQUENAME "FFG 39"
TACTIC BARRIER
WAYPOINT 551812.500000 613684.687500 0 10 -1 0.000000
AIRLOADOUT 12
AIRCRAFT 264 1
END

ENTITY 264 AIRENTITY
HULLID 3
ALLIANCE 0
POS 537527.375000 505879.812500 300
POINTS 100
COURSE 19
SPEED 150
PROB 100
DRIVEABLE 1
UNIQUENAME "MH-60R Seahawk -Player Ctrl-"
LOADOUTTYPE "ASW"
IFF 0
SOURCEOBJHULLID 2 INFLIGHT
TACTIC AREAWAYPOINTS
WAYPOINT 550549.812500 543603.312500 693 150 -1 0.000000
WAYPOINT 556232.062500 590324.312500 693 150 -1 0.000000
WAYPOINT 541079.000000 574540.500000 693 150 -1 0.000000
WAYPOINT 534134.250000 539183.812500 693 150 -1 0.000000
AIRLOADOUT -1
END

ENTITY 1691 SURFENTITY
HULLID 4
ALLIANCE 8
POS 541433.937500 509786.593750 0
POINTS 100
COURSE 240
SPEED 15
PROB 100
EMCON 1
UNIQUENAME "LCP 4"
TACTIC TRANSIT
WAYPOINT 496185.687500 484400.937500 0 15 -1 0.000000
AIRLOADOUT -1
END

GOAL 564439.750000 531607.375000 1.000000
BEGIN
GOALNAME "smuggler evades"
GOALID 1
PARENTGOALID -1
GOALTYPE 1
TRIGGERTYPE 1
STARTTIME 0
ENDTIME 0
POINTS 100
MAXSPEED -1
MINDEPTH -1.000000
MAXDEPTH -1.000000
RETURNTOBASE 0
AUDIO touch3.wav
ATTACHEDTARGETOBJ 4
OBJTOPROSECUTESIDE 0
OBJTOPROSECUTECOUNTRY 16
OBJTOPROSECUTECLASS 344
CREATEOBJECT 1 0
ACTION 3
MESSAGETYPEID 1
MESSAGETOHULLID -2
BEGINTEXT
Suspect vessel is not responding to our calls. They must have something to hide.
ENDTEXT
END
SCRIPTOBJECT
BEGIN
SCRIPTNAME "smuggler evasion 1"
SCRIPTID 1
SCRIPT
BEGINTEXT
SetCourse 4 165 0 <R>

SetSpeed 4 23 0 <R>


ENDTEXT
END

GOAL 566648.937500 531450.250000 0.000000
BEGIN
GOALNAME "smuggler evasion 2"
GOALID 2
PARENTGOALID -1
GOALTYPE 3
TRIGGERTYPE 1
GOALAGGDEPENDENT -1 1
GOALAGGMIN 1
STARTTIME 0
ENDTIME 0
POINTS 100
MAXSPEED -1
MINDEPTH -1.000000
MAXDEPTH -1.000000
RETURNTOBASE 0
AUDIO touch3.wav
CREATEOBJECT 3 0
ACTION 3
GOALDOCTRINE
BEGINTEXT
IF ( CompletedGoal -1 1 ) and<R>

( TimeSinceGoalTriggered 1 > 60 ) then<R>

GoalTriggered <R>

ENDIF
ENDTEXT
MESSAGETYPEID 0
BEGINTEXT
The engine of the fleeing vessel has given out! The crew is hailing us for assistance. Position the helo nearby to recover them.
ENDTEXT
END
SCRIPTOBJECT
BEGIN
SCRIPTNAME "smuggler evasion script2"
SCRIPTID 3
SCRIPT
BEGINTEXT
SetSpeed 4 0 0 <R>

AddEffect 2 4 <R>


ENDTEXT
END

GOAL 568306.187500 531292.437500 0.900000
BEGIN
GOALNAME "smugglers rescued"
GOALID 3
PARENTGOALID -1
GOALTYPE 1
DURATION 120.000008
TRIGGERTYPE 1
STARTTIME 0
ENDTIME 0
POINTS 100
MAXSPEED 50
MINDEPTH -1.000000
MAXDEPTH 200.000000
RETURNTOBASE 0
AUDIO touch3.wav
ATTACHEDTARGETOBJ 4
OBJTOPROSECUTESIDE 0
OBJTOPROSECUTECOUNTRY 16
OBJTOPROSECUTECLASS 24
GOALDOCTRINE
BEGINTEXT
IF ( CompletedGoal -1 2 ) then<R>

GoalTriggered <R>

ENDIF
ENDTEXT
MESSAGETYPEID 0
MESSAGETOHULLID -2
BEGINTEXT
Helo Control this is Guardian 1, we have recovered the crew. Prepare flight deck for helo landing ops.
ENDTEXT
END
GOAL 569884.625000 531410.750000 0.000000
BEGIN
GOALNAME "Smugglers Busted"
GOALID 4
PARENTGOALID -1
GOALTYPE 3
TRIGGERTYPE 2
STARTTIME 0
ENDTIME 0
POINTS 100
MAXSPEED -1
MINDEPTH -1.000000
MAXDEPTH -1.000000
RETURNTOBASE 0
CRITICAL 1
SUCCESSMESSAGE
BEGINTEXT
You rescued the crew of the distressed smuggling vessel.
ENDTEXT
FAILUREMESSAGE
BEGINTEXT
Mission in progress or failed...
ENDTEXT
DESCRIPTION
BEGINTEXT
helo lands with rescued smuggler crew
ENDTEXT
GOALDOCTRINE
BEGINTEXT
IF ( CompletedGoal -1 3 ) and<R>

( AirEntLanding 3 2 ) then<R>

GoalTriggered <R>

ENDIF
ENDTEXT
MESSAGETYPEID 0
BEGINTEXT

ENDTEXT
END
MAPLINES
LINE 289.971191 339.660980 301.542786 290.651886
LINE 301.542786 290.651886 304.265503 258.659851
LINE 304.265503 258.659851 298.139374 228.709839
LINE 298.139374 228.709839 287.929138 196.037109
LINE 287.929138 196.037109 273.634827 161.322342
LINE 289.970459 339.681519 272.846863 376.846497
LINE 272.846863 376.846497 242.870483 400.093475
END

rentacow is offline   Reply With Quote
Old 09-27-16, 01:45 AM   #8
Micksp
Sailor man
 
Join Date: Apr 2002
Location: Burgas, Bulgaria
Posts: 50
Downloads: 31
Uploads: 0
Default

After 3 days of seakness I'm back on duty. Also managed the DW to work proper at my home PC. It was a simple sollution, just installed the latest NVIDIA drivers and ooops
I will take a look on your mission later today. I'm also planing a small camaign placed in the Black Sea region, hope i will prepare it in a week. I will create couple controllable units and will try to put the missions time for about 2 hrs, which will make it co-op MP playable. In the past being GNSF member bot missions has been limited to 2 hrs to prevent crashes and boring.

Best Regards!
Micksp is offline   Reply With Quote
Old 09-27-16, 03:21 AM   #9
rentacow
Machinist's Mate
 
Join Date: Sep 2014
Location: Onakushcloud
Posts: 125
Downloads: 55
Uploads: 0
Default

I finished the mission which prompted this post asking for help. Despite what I wrote in the description, it can be completed in under 3 hours and will be a failure after about 4 hours since that's how long it takes the smugglers to get to shore.

The thread is here where you can download the completed mission:
http://www.subsim.com/radioroom/showthread.php?t=227799
rentacow is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 09:59 AM.


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.