Welcome to the new Diaspora forums, please let us know if you see anything broken! Notice: Some users may need to reupload their avatars due to an issue during forum setup!

# Better core explosions

Registered Posts: 170
edited August 2012 #1
How about when the cores die, there are a bunch of little Half Life 2 explosions on random props, then when the core explodes it unwelds all the props and we add a little force to the explosion, pushing the props away and making real debris, not props falling awkwardly through space and exploding all the way.
EDIT: they would also explode and disappear as they normally do.
Every Human Being has some capacity for evil. It's just that some Humans have a greater capacity for evil than others.

How about when the cores die, there are a bunch of little Half Life 2 explosions on random props, then when the core explodes it unwelds all the props and we add a little force to the explosion, pushing the props away and making real debris, not props falling awkwardly through space and exploding all the way.
EDIT: they would also explode and disappear as they normally do.
They do that already, but only if your ship is not parented. Needless to say, it's not a common effect that someone would see.
• Registered, Moderator Posts: 534
It would also be nice to have fires and stuff appearing on random props when a ship was down to Hull, like in EVE.

"I want you to show this world what it means to fear the sky."
Lambda217 wrote:
It would also be nice to have fires and stuff appearing on random props when a ship was down to Hull, like in EVE.
That I would not be against. Also, I think, and have thought, that the bigger ships need to explode like capital ships in Homeworld 2. That is, instead of just instantly kerploding when hull reaches 0, the ship grinds to a halt (it would be cool to keep momentum, but GMod maps aren't big enough for that), random explosions appear around the ship, and suddenly the core "overloads" in a nuclear flash of doom.
• Registered, Moderator Posts: 534

This I endorse.

"I want you to show this world what it means to fear the sky."
• Registered, Moderator Posts: 147
Do you guys remember the way my ship (Eagle 2) exploded? I coded an e2 chip to do EXACTLY what Anubis described.

If Hull less than 5%, get array of all props, unparent, unweld, self destruct core, add random force and rotation.

It didn't always work though, like if the hull was at 6% and someone shot at the ship doing 7% damage, then the core would kill the chip before it had a chance to execute. But the times it did work, it was a spectacular show!

Found the old code!
You have to say !sd to arm the system (otherwise it would explode when pasting the core cause it starts at 0% for a brief second)
The IN input is the core percentage or amount or whatever you want it to be. The SD output gets wired to the Self Destruct Entity. The ALARM output is for debugging. If you use it, be sure to go through the code and change all the Eagle2 specific stuff to your needs (right now its only set to work on caldari cores). It's also set up to 'splode in 5 seconds if you type !boom
There's a lot of redundancies and checks built in to make sure it all goes smoothly, it's probably WAY more complicated than it needs to be (like all my coding) but it works, sometimes...
@name Eagle2 Self Destruct
@inputs In Pod:entity
@outputs SD Alarm
@persist Objects:array &#91;Gyro,Core,SDEnt&#93;:entity SDA Chat
if (first()|dupefinished()) {
runOnChat(1)
Alarm=0
SDA=0
Chat=0
Objects = entity():getConstraints()
for(I = 1, Objects:count()){
if (Objects&#91;I,entity&#93;:type()=="ship_core_caldari") {Core=Objects&#91;I,entity&#93;}
if (Objects&#91;I,entity&#93;:type()=="sc_self_destruct") {SDEnt=Objects&#91;I,entity&#93;}
}
}
if (!Chat&owner():lastSaidWhen()&gt;=curtime()-1 & owner():lastSaid():lower()=="!sd") {hideChat(1), timer("hidechat",1000), SDA=1, print("Self Destruct Online"),Chat=1}
if (SDA& In&lt;=5000 ) {timer("blow", 10), SDA=0}
if (Chat&owner():lastSaidWhen()&gt;=curtime()-1 & owner():lastSaid():lower()=="!boom") {
Alarm=1
hideChat(1), timer("hidechat",1000),
timer("cd5",10)
timer("cd4",1000)
timer("cd3",2000)
timer("cd2",3000)
timer("cd1",4000)
timer("blow",5000)
Pod:printDriver("Self Destruct Activated, MotherFucker!")
Pod:soundPlay(28, 5, "ambient/alarms/siren.wav")
Chat=0
}
if (Alarm) {
if (clk("cd5")) {Pod:printDriver("Eagle2 Self Destruct In: 5")}
if (clk("cd4")) {Pod:printDriver("Eagle2 Self Destruct In: 4")}
if (clk("cd3")) {Pod:printDriver("Eagle2 Self Destruct In: 3")}
if (clk("cd2")) {Pod:printDriver("Eagle2 Self Destruct In: 2")}
if (clk("cd1")) {Pod:printDriver("Eagle2 Self Destruct In: 1")}
if (!Chat&clk("blow")) {Pod:printDriver("Have a nice day!")}
}

if (clk("blow")) {
print("Boom")
Core:deparent()
Core:unWeld()
Gyro:propDelete()
timer("deparent", 100)
}
if(clk("deparent")) {
print("deparent")
for(I = 1, Objects:count()){
Objects&#91;I,entity&#93;:deparent()
}
timer("fling", 100)
}
if(clk("fling")) {
print("fling")
Core:weld(SDEnt)
SD=1
for(I = 1, Objects:count()){
Objects&#91;I,entity&#93;:propGravity(0)
Rand1=random(-1,1)
Rand2=random(-1,1)
Rand3=random(-1,1)
Rand4=randint(300,1000)
Rand5=randint(10,100)
Objects&#91;I,entity&#93;:setVel(vec(Rand1,Rand2,Rand3)*Rand4)
Objects&#91;I,entity&#93;:setAngVel(ang(Rand1,Rand2,Rand3)*Rand5)
}
}
if (clk("hidechat")) {hideChat(0)}

• Registered Posts: 170
Do you guys remember the way my ship (Eagle 2) exploded? I coded an e2 chip to do EXACTLY what Anubis described.

If Hull less than 5%, get array of all props, unparent, unweld, self destruct core, add random force and rotation.

It didn't always work though, like if the hull was at 6% and someone shot at the ship doing 7% damage, then the core would kill the chip before it had a chance to execute. But the times it did work, it was a spectacular show!

Found the old code!
You have to say !sd to arm the system (otherwise it would explode when pasting the core cause it starts at 0% for a brief second)
The IN input is the core percentage or amount or whatever you want it to be. The SD output gets wired to the Self Destruct Entity. The ALARM output is for debugging. If you use it, be sure to go through the code and change all the Eagle2 specific stuff to your needs (right now its only set to work on caldari cores). It's also set up to 'splode in 5 seconds if you type !boom
There's a lot of redundancies and checks built in to make sure it all goes smoothly, it's probably WAY more complicated than it needs to be (like all my coding) but it works, sometimes...
@name Eagle2 Self Destruct
@inputs In Pod:entity
@outputs SD Alarm
@persist Objects:array &#91;Gyro,Core,SDEnt&#93;:entity SDA Chat
if (first()|dupefinished()) {
runOnChat(1)
Alarm=0
SDA=0
Chat=0
Objects = entity():getConstraints()
for(I = 1, Objects:count()){
if (Objects&#91;I,entity&#93;:type()=="ship_core_caldari") {Core=Objects&#91;I,entity&#93;}
if (Objects&#91;I,entity&#93;:type()=="sc_self_destruct") {SDEnt=Objects&#91;I,entity&#93;}
}
}
if (!Chat&owner():lastSaidWhen()&gt;=curtime()-1 & owner():lastSaid():lower()=="!sd") {hideChat(1), timer("hidechat",1000), SDA=1, print("Self Destruct Online"),Chat=1}
if (SDA& In&lt;=5000 ) {timer("blow", 10), SDA=0}
if (Chat&owner():lastSaidWhen()&gt;=curtime()-1 & owner():lastSaid():lower()=="!boom") {
Alarm=1
hideChat(1), timer("hidechat",1000),
timer("cd5",10)
timer("cd4",1000)
timer("cd3",2000)
timer("cd2",3000)
timer("cd1",4000)
timer("blow",5000)
Pod:printDriver("Self Destruct Activated, MotherFucker!")
Pod:soundPlay(28, 5, "ambient/alarms/siren.wav")
Chat=0
}
if (Alarm) {
if (clk("cd5")) {Pod:printDriver("Eagle2 Self Destruct In: 5")}
if (clk("cd4")) {Pod:printDriver("Eagle2 Self Destruct In: 4")}
if (clk("cd3")) {Pod:printDriver("Eagle2 Self Destruct In: 3")}
if (clk("cd2")) {Pod:printDriver("Eagle2 Self Destruct In: 2")}
if (clk("cd1")) {Pod:printDriver("Eagle2 Self Destruct In: 1")}
if (!Chat&clk("blow")) {Pod:printDriver("Have a nice day!")}
}

if (clk("blow")) {
print("Boom")
Core:deparent()
Core:unWeld()
Gyro:propDelete()
timer("deparent", 100)
}
if(clk("deparent")) {
print("deparent")
for(I = 1, Objects:count()){
Objects&#91;I,entity&#93;:deparent()
}
timer("fling", 100)
}
if(clk("fling")) {
print("fling")
Core:weld(SDEnt)
SD=1
for(I = 1, Objects:count()){
Objects&#91;I,entity&#93;:propGravity(0)
Rand1=random(-1,1)
Rand2=random(-1,1)
Rand3=random(-1,1)
Rand4=randint(300,1000)
Rand5=randint(10,100)
Objects&#91;I,entity&#93;:setVel(vec(Rand1,Rand2,Rand3)*Rand4)
Objects&#91;I,entity&#93;:setAngVel(ang(Rand1,Rand2,Rand3)*Rand5)
}
}
if (clk("hidechat")) {hideChat(0)}

I must have picked up something without knowing it, because I actually understood some of that. Saying that, I am still glad it's already Caldari because Caldari is all I use anyway .
Every Human Being has some capacity for evil. It's just that some Humans have a greater capacity for evil than others.
• Registered, Moderator Posts: 147
Another important line is line 19:

if (SDA& In<=5000 ) {timer("blow", 10), SDA=0}

5000 being the number used to determine when to explode from the IN input. I had it wired to the Hull raw number.

Let me know if the the thing actually still works. And if it does, take a video of it and post it in here to show the awesomeness of implementing it into the actual core entitys.

and if it doesn't work, fix it, damnit!
Another important line is line 19:

if (SDA& In<=5000 ) {timer("blow", 10), SDA=0}

5000 being the number used to determine when to explode from the IN input. I had it wired to the Hull raw number.

Let me know if the the thing actually still works. And if it does, take a video of it and post it in here to show the awesomeness of implementing it into the actual core entitys.

and if it doesn't work, fix it, damnit!
The only thing I can think of is that, if the extension is still in and functional, I once added a "getCoreEntity()" or something function that would get whatever core a target prop belongs to. I don't quite remember the exact function name, but it should be in the search box somewhere.