Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit e17ccc7

Browse files
committed
Extensive Flame particle rework
1 parent 88a7596 commit e17ccc7

File tree

185 files changed

+127
-98
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+127
-98
lines changed

Base.rte/Effects.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ AddEffect = MOPixel
301301
GlobalAccScalar = -0.4
302302
RestThreshold = 500
303303
LifeTime = 75
304-
Sharpness = 125
304+
Sharpness = 180
305305
HitsMOs = 1
306306
GetsHitByMOs = 0
307307
Color = Color

Base.rte/Effects/Pyro.ini

Lines changed: 68 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -942,8 +942,8 @@ AddEffect = MOSParticle
942942
FilePath = Base.rte/Effects/Pyro/SmallBlast01.bmp
943943
FrameCount = 19
944944
SpriteOffset = Vector
945-
X = -4.5
946-
Y = -4.5
945+
X = -4
946+
Y = -4
947947
AngularVel = 0
948948
Atom = Atom
949949
Material = Material
@@ -955,14 +955,14 @@ AddEffect = MOSParticle
955955
AddEffect = MOSParticle
956956
CopyOf = Flame Smoke 1
957957
PresetName = Flame Smoke 2
958-
GlobalAccScalar = -0.2
959-
AirResistance = 0.2
960-
AirThreshold = 6
961-
LifeTime = 1200
962958
SpriteFile = ContentFile
963-
FilePath = Base.rte/Effects/Pyro/SmallSmoke01.bmp
964-
FrameCount = 12
965-
959+
FilePath = Base.rte/Effects/Pyro/SmallBlast02.bmp
960+
Mass = 0.49
961+
LifeTime = 600
962+
GlobalAccScalar = -0.6
963+
AirResistance = 0.05
964+
AirThreshold = 3
965+
966966

967967
AddEffect = MOSParticle
968968
PresetName = Flame 1
@@ -973,7 +973,7 @@ AddEffect = MOSParticle
973973
HitsMOs = 0
974974
GetsHitByMOs = 0
975975
SpriteFile = ContentFile
976-
FilePath = Base.rte/Effects/Pyro/Flame/Flame00.bmp
976+
FilePath = Base.rte/Effects/Pyro/Flame/Flame.bmp
977977
FrameCount = 56
978978
SpriteOffset = Vector
979979
X = -10
@@ -1002,7 +1002,7 @@ AddEffect = MOSParticle
10021002
HitsMOs = 0
10031003
GetsHitByMOs = 0
10041004
SpriteFile = ContentFile
1005-
FilePath = Base.rte/Effects/Pyro/Flame/Flame00.bmp
1005+
FilePath = Base.rte/Effects/Pyro/Flame/Flame.bmp
10061006
FrameCount = 56
10071007
SpriteOffset = Vector
10081008
X = -10
@@ -1111,17 +1111,19 @@ AddAmmo = MOSRotating
11111111

11121112
AddEffect = MOSParticle
11131113
PresetName = Flame 1 Hurt
1114-
AirResistance = 0.01
1114+
GlobalAccScalar = 0.9
1115+
AirResistance = 0.05
1116+
AirThreshold = 1
11151117
RestThreshold = -1
11161118
Mass = 0.98
1117-
LifeTime = 8000
1119+
LifeTime = 6000
11181120
Sharpness = 0.1
11191121
HitsMOs = 0
11201122
GetsHitByMOs = 0
11211123
ScriptPath = Base.rte/Effects/Pyro/Flame/Flame.lua
11221124
SpriteFile = ContentFile
1123-
FilePath = Base.rte/Effects/Pyro/Flame/Flame00.bmp
1124-
FrameCount = 84
1125+
FilePath = Base.rte/Effects/Pyro/Flame/Flame.bmp
1126+
FrameCount = 86
11251127
SpriteOffset = Vector
11261128
X = -10
11271129
Y = -19
@@ -1133,10 +1135,10 @@ AddEffect = MOSParticle
11331135
FilePath = Base.rte/Effects/Glows/FireGlow1.bmp
11341136
EffectAlwaysShows = 0
11351137
EffectStartTime = -1
1136-
EffectStopTime = 8000
1138+
EffectStopTime = 6000
11371139
EffectStartStrength = 0.5
11381140
EffectStopStrength = 0.1
1139-
RandomizeEffectRotAngleEveryFrame = 1
1141+
RandomizeEffectRotAngle = 1
11401142
Framerate = 0
11411143

11421144

@@ -1151,17 +1153,39 @@ AddEffect = MOSParticle
11511153
Framerate = 0
11521154

11531155

1156+
AddEffect = MOSParticle
1157+
CopyOf = Flame 2 Hurt
1158+
PresetName = Flame Hurt Short
1159+
GlobalAccScalar = 0.5
1160+
LifeTime = 4500
1161+
EffectStartTime = 10
1162+
1163+
1164+
AddEffect = MOSParticle
1165+
CopyOf = Flame Hurt Short
1166+
PresetName = Flame Hurt Short Float
1167+
GlobalAccScalar = -0.1
1168+
1169+
1170+
AddEffect = MOSParticle
1171+
CopyOf = Flame 1 Hurt
1172+
PresetName = Ground Flame
1173+
LifeTime = 7500
1174+
EffectStopStrength = 0
1175+
1176+
11541177
AddEffect = PEmitter
11551178
PresetName = Flame 1 Hurt Emitter
1179+
AirResistance = 0.01
11561180
RestThreshold = -1
11571181
Mass = 0.98
11581182
LifeTime = 8000
11591183
Sharpness = 0.1
11601184
HitsMOs = 0
11611185
GetsHitByMOs = 0
11621186
SpriteFile = ContentFile
1163-
FilePath = Base.rte/Effects/Pyro/Flame/Flame00.bmp
1164-
FrameCount = 56
1187+
FilePath = Base.rte/Effects/Pyro/Flame/Flame.bmp
1188+
FrameCount = 84
11651189
SpriteOffset = Vector
11661190
X = -10
11671191
Y = -19
@@ -1170,64 +1194,44 @@ AddEffect = PEmitter
11701194
CopyOf = Rubber
11711195
TrailLength = 0
11721196
ScreenEffect = ContentFile
1173-
FilePath = Base.rte/Effects/Glows/YellowSmall.bmp
1174-
EffectAlwaysShows = 1
1175-
EffectStartTime = 0
1197+
FilePath = Base.rte/Effects/Glows/FireGlow1.bmp
1198+
EffectAlwaysShows = 0
1199+
EffectStartTime = -1
11761200
EffectStopTime = 8000
1177-
EffectStartStrength = 0.50
1178-
EffectStopStrength = 0.0
1201+
EffectStartStrength = 0.5
1202+
EffectStopStrength = 0.1
1203+
RandomizeEffectRotAngleEveryFrame = 1
11791204
Framerate = 0
11801205
AddEmission = Emission
11811206
EmittedParticle = MOPixel
1182-
CopyOf = Flame Hurt Particle
1207+
CopyOf = Ground Fire Burn Particle
1208+
ParticlesPerMinute = 1200
1209+
LifeVariation = 0.25
11831210
Spread = 1.5
1184-
MaxVelocity = 15
1185-
MinVelocity = 10
1211+
MaxVelocity = 20
1212+
MinVelocity = -10
1213+
PushesEmitter = 0
1214+
AddEmission = Emission
1215+
EmittedParticle = MOSParticle
1216+
CopyOf = Flame Smoke 2
1217+
ParticlesPerMinute = 1600
1218+
LifeVariation = 0.50
1219+
Spread = 1.5
1220+
MaxVelocity = 8
1221+
MinVelocity = -4
11861222
PushesEmitter = 0
1187-
EmissionEnabled = 1
11881223
EmissionAngle = Matrix
1189-
AngleDegrees = 240
1224+
AngleDegrees = 90
1225+
EmissionEnabled = 1
11901226
EmissionsIgnoreThis = 0
1191-
ParticlesPerMinute = 150
1192-
BurstSize = 0
1193-
BurstScale = 0
1227+
BurstSize = 5
1228+
BurstScale = 2
11941229
BurstTriggered = 0
11951230

11961231

11971232
AddEffect = PEmitter
1233+
CopyOf = Flame 1 Hurt Emitter
11981234
PresetName = Flame 2 Hurt Emitter
1199-
RestThreshold = -1
1200-
Mass = 0.98
1201-
LifeTime = 8000
1202-
Sharpness = 0.1
1203-
HitsMOs = 0
1204-
GetsHitByMOs = 0
1205-
SpriteFile = ContentFile
1206-
FilePath = Base.rte/Effects/Pyro/Flame/Flame00.bmp
1207-
FrameCount = 56
1208-
SpriteOffset = Vector
1209-
X = -10
1210-
Y = -19
1211-
Atom = Atom
1212-
Material = Material
1213-
CopyOf = Rubber
1214-
TrailLength = 0
1215-
Framerate = 0
1216-
AddEmission = Emission
1217-
EmittedParticle = MOPixel
1218-
CopyOf = Flame Hurt Particle
1219-
Spread = 1.5
1220-
MaxVelocity = 15
1221-
MinVelocity = 10
1222-
PushesEmitter = 0
1223-
EmissionEnabled = 1
1224-
EmissionAngle = Matrix
1225-
AngleDegrees = 180
1226-
EmissionsIgnoreThis = 0
1227-
ParticlesPerMinute = 150
1228-
BurstSize = 0
1229-
BurstScale = 0
1230-
BurstTriggered = 0
12311235

12321236

12331237
///////////////////////////////////////////////////////////////////////

Base.rte/Effects/Pyro/Flame/Flame.lua

Lines changed: 58 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,77 @@
11
function Create(self)
2-
self.strength = 80;
2+
self.strength = 1;
33
self.checkTimer = Timer();
4-
self.checkDelay = math.random(20);
4+
self.checkDelay = math.random(30);
5+
if string.find(self.PresetName, "Short") then
6+
self.isShort = true;
7+
self.deleteDelay = self.Lifetime * RangeRand(0.05, 0.15);
8+
end
9+
if string.find(self.PresetName, "Ground") then
10+
self.notSticky = true;
11+
end
512
end
6-
713
function Update(self)
814
self.ToSettle = false;
9-
if self.target and IsMOSRotating(self.target) then
10-
self.Vel = self.target.Vel;
11-
self.Pos = self.target.Pos - Vector(self.stickPos.X, self.stickPos.Y):RadRotate(self.target.RotAngle - self.targetStickAngle);
12-
local actor = MovableMan:GetMOFromID(self.target.RootID);
13-
if MovableMan:IsActor(actor) then
14-
actor = ToActor(actor);
15-
if math.random() < (self.strength * self.target.DamageMultiplier) / actor.Mass / (self.target.Material.StructuralIntegrity) then
16-
actor.Health = actor.Health - 1;
15+
if not self.notSticky then
16+
if self.target and IsMOSRotating(self.target) then
17+
self.Vel = self.target.Vel;
18+
self.Pos = self.target.Pos + Vector(self.stickPos.X, self.stickPos.Y):RadRotate(self.target.RotAngle - self.targetStickAngle);
19+
local actor = MovableMan:GetMOFromID(self.target.RootID);
20+
if MovableMan:IsActor(actor) then
21+
actor = ToActor(actor);
22+
if math.random() < (self.strength * self.target.DamageMultiplier) / (actor.Mass + self.target.Material.StructuralIntegrity) then
23+
actor.Health = actor.Health - 1;
24+
end
1725
end
18-
end
19-
else
20-
self.target = nil;
21-
if self.checkTimer:IsPastSimMS(self.checkDelay) then
22-
self.checkTimer:Reset();
23-
self.checkDelay = self.checkDelay + 1; -- Gradually extend the delay for optimization reasons
24-
local checkPos = self.Pos + Vector(self.Vel.X, self.Vel.Y):SetMagnitude(math.sqrt(self.Vel.Magnitude));
25-
local moCheck = SceneMan:GetMOIDPixel(checkPos.X, checkPos.Y);
26-
if moCheck ~= rte.NoMOID then
27-
local mo = MovableMan:GetMOFromID(moCheck);
28-
if mo then
29-
self.target = ToMOSRotating(mo);
30-
self.targetStickAngle = mo.RotAngle;
31-
self.stickPos = SceneMan:ShortestDistance(mo.Pos, self.Pos, SceneMan.SceneWrapsX) * 0.8;
32-
self.Pos = mo.Pos - Vector(self.stickPos.X, self.stickPos.Y);
26+
else
27+
self.target = nil;
28+
if self.checkTimer:IsPastSimMS(self.checkDelay) then
29+
self.checkTimer:Reset();
30+
self.checkDelay = self.checkDelay + 3; -- Gradually extend the delay for optimization reasons
31+
local checkPos = self.Pos + self.Vel * rte.PxTravelledPerFrame * math.random();
32+
local moCheck = SceneMan:GetMOIDPixel(checkPos.X, checkPos.Y);
33+
if moCheck ~= rte.NoMOID then
34+
local mo = MovableMan:GetMOFromID(moCheck);
35+
if mo then
36+
self.target = ToMOSRotating(mo);
37+
38+
self.isShort = true;
39+
self.deleteDelay = math.random(self.Lifetime);
40+
self.GlobalAccScalar = 0.9;
41+
42+
self.targetStickAngle = mo.RotAngle;
43+
self.stickPos = SceneMan:ShortestDistance(mo.Pos, self.Pos, SceneMan.SceneWrapsX) * 0.8;
44+
self.Pos = mo.Pos + Vector(self.stickPos.X, self.stickPos.Y);
45+
end
46+
end
47+
if self.deleteDelay and self.Age > self.deleteDelay then
48+
self.ToDelete = true;
3349
end
3450
end
3551
end
3652
end
37-
local age = self.Age * 0.0001 + 1; -- Have age slightly affect particle settings relative to 10 seconds
53+
local age = (self.Age * 0.0001) + 1; -- Have age slightly affect particle settings relative to 10 seconds
3854
local chance = math.random();
3955
local particle;
4056
if chance < (0.1 / age) then
4157
particle = CreateMOPixel("Ground Fire Burn Particle");
42-
particle.Vel = self.Vel + Vector(RangeRand(-10, 10), -math.random(5, 20));
43-
elseif chance < (1 / age) then
44-
particle = CreateMOSParticle("Flame Smoke 1");
45-
particle.Vel = self.Vel + Vector(0, -3) + Vector(math.random(0, 3), 0):RadRotate(math.random() * 6.28);
46-
particle.Lifetime = 100 + math.random(math.ceil(700 / age));
58+
particle.Vel = self.Vel + Vector(RangeRand(-15, 15), -math.random(-10, 20));
59+
particle.Sharpness = particle.Sharpness * RangeRand(0.5, 1.0);
60+
elseif chance < (0.5 / age) then
61+
-- Spawn another, shorter flame particle occasionally
62+
if not self.isShort and math.random() < 0.05 then
63+
particle = CreateMOSParticle("Flame Hurt Short Float");
64+
particle.Lifetime = 4000 / age;
65+
particle.Vel = self.Vel + Vector(0, -3);
66+
else
67+
particle = CreateMOSParticle("Flame Smoke 2");
68+
particle.Lifetime = math.random(250, 1000) / age;
69+
particle.Vel = self.Vel + Vector(0, -1);
70+
end
71+
particle.Vel = particle.Vel + Vector(math.random(), 0):RadRotate(math.random() * 6.28);
4772
end
4873
if particle then
49-
particle.Pos = Vector(self.Pos.X + math.random(-1, 1), self.Pos.Y - math.random(0, 2));
74+
particle.Pos = Vector(self.Pos.X + math.random(-2, 2), self.Pos.Y - math.random(0, 4));
5075
MovableMan:AddParticle(particle);
5176
end
5277
end
-1.52 KB
Binary file not shown.
-1.52 KB
Binary file not shown.
-1.52 KB
Binary file not shown.
-1.52 KB
Binary file not shown.
-1.52 KB
Binary file not shown.
-1.52 KB
Binary file not shown.

0 commit comments

Comments
 (0)