This repository has been archived by the owner on May 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSampleMission.lua
188 lines (188 loc) · 8.06 KB
/
SampleMission.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
-- This is a sample Transport Mission
-- Made by Paul Masan (Paulchen/Raining-Cloud)
-- My GitHub for more cool stuff: https://github.com/Raining-Cloud
-- ----------------------------------------------------------------------------
-- ----------------------------------------------------------------------------
-- -----------------------NOT TESTED BUT IT SHOULD WORK------------------------
-- ----------------------------------------------------------------------------
-- ----------------------------------------------------------------------------
ModLoader.addContent(
"mission",
{
contentName = "mission01",
author = "Author Name",
class = IngameMission,
title = "Mission Title",
fullDesc = "This is a sample Mission. You can add your description here",
duration = IngameMission.getTransportMissionDuration,
remuneration = IngameMission.getTransportMissionRemuneration,
prerequisites = IngameMission.getTransportMissionPrerequisites,
relativeFrequency = function()
return 9999
end,
extraReward = IngameMission.getTransportMissionExtraReward,
moneyPerMinute = 2000,
-- Add your Map ID here
compatibleMapIds = {
"HR_HallsteinSeason2"
},
variables = {
-- all positions where the mission shall start from, to add variety you can add multiple tables
fetchFrom = {
{
vehiclePosition = Vector3:new(131, 421, 856),
prefabPosition = Vector3:new(113, 421, 855),
label = "Hotel Central",
relativeFrequency = 1
}
},
-- all positions where the mission ends, to add variety you can add multiple tables
deliverTo = {
{
vehiclePosition = Vector3:new(975, 584, 269),
prefabPosition = Vector3:new(975, 584, 269),
label = "Almrestaurant",
relativeFrequency = 1
}
},
-- the vehicles that can be used for this mission
vehicle = {
{
vehicleType = "default.MarmottaHazard",
avgSpeed = 40 * 0.85,
extraTime = 50,
relativeFrequency = 1,
locked = IngameMission.isVehicleLocked
},
{
vehicleType = "default.Vattenmask",
avgSpeed = 30 * 0.85,
extraTime = 45,
relativeFrequency = 1,
locked = IngameMission.isVehicleLocked
},
{
vehicleType = "default.MarmottaTiger",
avgSpeed = 35 * 0.85,
extraTime = 47,
relativeFrequency = 1,
locked = IngameMission.isVehicleLocked
},
--Not sure if the pistenbully work but should be possible
{
vehicleType = "default.pistenbully100",
avgSpeed = 35 * 0.40,
extraTime = 8,
relativeFrequency = 1,
locked = IngameMission.isVehicleLocked
},
{
vehicleType = "default.pistenbully600",
avgSpeed = 35 * 0.40,
extraTime = 8,
relativeFrequency = 1,
locked = IngameMission.isVehicleLocked
},
{
vehicleType = "default.pistenbully600W",
avgSpeed = 35 * 0.40,
extraTime = 8,
relativeFrequency = 1,
locked = IngameMission.isVehicleLocked
}
},
-- the transport object which will be spawned
prefabType = {
{label = "$mission_prefab_packets", prefabName = "internal/deliveryPackage", timeCoeff = 1.5},
{label = "$mission_prefab_fireExtinguisher", prefabName = "internal/missions/fireExtinguisher"},
{label = "$mission_prefab_wheelieBin", prefabName = "internal/missions/wheelieBin"},
{label = "$mission_prefab_plasticBarrel", prefabName = "internal/missions/plasticBarrel"},
{label = "$mission_prefab_metalBarrel", prefabName = "internal/missions/metalBarrel"}
}
},
events = {
-- spawn the transport object at the given location at the start of the mission
start = function(self, properties)
self.packageId =
DeliverySystem.spawnObject(
properties.prefabType.prefabName,
properties.fetchFrom.prefabPosition,
properties.fetchFrom.prefabRotation or 0
)
end,
-- despawn at the end of the mission
destroy = function(self, properties)
DeliverySystem.destroyAllObjects()
end
},
-- task stack shows the next task for the player
tasks = function(self, properties)
return {
{
type = "showMissionInfo"
},
-- go to the start point
{
type = "trigger",
title = l10n.format(
"transportMission01_stack_1a_pickUp",
l10n.getDollar(properties.fetchFrom.label)
),
message = l10n.format(
"transportMission01_stack_1b_driveThere",
VehicleManager:getVehicleTypeName(properties.vehicle.vehicleType)
),
position = properties.fetchFrom.vehiclePosition,
validateObjectId = IngameMission.validateMissionVehicle
},
-- start the countdown
{
type = "startCountdown"
},
-- show the transport object position
{
type = "hint",
title = l10n.format(
"transportMission01_stack_1a_pickUp",
l10n.getDollar(properties.fetchFrom.label)
),
message = l10n.format(
"transportMission01_stack_1c_load",
l10n.getDollar(properties.prefabType.label)
),
checkSkip = DeliverySystem.allPackagesOnVehicle
},
--show the target location
{
type = "trigger",
title = l10n.format(
"transportMission01_stack_2a_deliver",
l10n.getDollar(properties.deliverTo.label)
),
message = "$transportMission01_stack_2b_driveToMarkedSpot",
position = properties.deliverTo.vehiclePosition,
validateObjectId = IngameMission.validateMissionVehicle
},
-- deliver the transport object to the target location
{
type = "hint",
title = "$transportMission01_stack_3a_pickUpPacket",
message = "$transportMission01_stack_3b_unloadPacket",
checkSkip = IngameMission.anyPackagePickedUp
},
--put the transport object in the deliver point
{
type = "trigger",
title = "$transportMission01_stack_3c_deliverPacket",
message = "$transportMission01_stack_3d_deliverPacket2",
position = properties.deliverTo.prefabPosition,
validateObjectId = IngameMission.packageDrop
},
-- stop the countdown
{
type = "stopCountdown"
}
}
end,
}
)