Making a Crashing Spaceship [Solved]

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Making a Crashing Spaceship [Solved]

Post by thelegend »

I know how to make a Spaceship, that is placed high above the the ground. But I don't know how to make a scripted event that starts a ZeroEditor Animation after a specific object is destroyed.

Here's how it was planned:

Code: Select all

1. Two Star Destroyers are placed high above the ground at the exact same place (X,Y,Z coords must be the same)

2. Both Ships have two different names (e.g. Destroyer_A, Destroyer_B)

3. Destroyer_B has to be animated. It must be a "crashing" animation. From the sky, through the clouds until it hits the ground

4. Then in the .lua there must be the following codes below function ScriptPostLoad():

-KillObject("Destroyer_B")

5. After Destroyer_A would have been destroyed ingame Destroyer B should respawn.
And now I am stucking in trouble:
There is "RespawnObject("Destroyer_B")". It must be "enabled" after Destroyer_A has been destroyed. Also after Destroyer_B has ben respawned the ZeroEditor Crashing animation must be enabled. So first, respawn after killed object, then respawned object must start to be animated (Crashing).

That's all so far. It would possibly work if I knew how to script that. Thank you very much if you could help me.
Last edited by thelegend on Sat Oct 10, 2015 6:55 am, edited 1 time in total.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Making a Crashing Spaceship

Post by AQT »

Have you already looked at this topic?
You seem to have the logic down for your event so hopefully the above will lead you in the right direction, coding-wise. By the way, I'd personally spawn in Destroyer_B upon the destruction of Destroyer_A instead of having it wait around and cause possibly collision and z-fighting issues.
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: Making a Crashing Spaceship

Post by thelegend »

Thank you. I knew there was a tutorial about this. I must have forgptten its existence :o
Anyway I added the first set of lines below function ScriptPostLoad() and renamed all the required names:

Code: Select all

animateobja = OnObjectKill(
   function(object)
      if GetEntityName(object) == "Star_Destroyer_2_A" then
	--RespawnObject("Star_Destroyer_2_B")
         PlayAnimation("Crash_2")
      end
   end
)
Currently I keep both objects at the same position, but I will kill the animated object and then respawn it back after the first destroyer has been destroyed.
Unfortunately the animation of Star_Destroyer_2_B doesn't start after Star_Destroyer_2_A has been destroyed.

The animation group only containing one single animation is called "Crash_2".
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Making a Crashing Spaceship

Post by AQT »

Did you disable hierarchies for that animation group? Also, is Star_Destroyer_2_B in another animation group that plays prior to "Crash_2" playing? Usually, when an object has already been animated, it can't be animated for a second time for a reason I have yet to pinpoint.

I suggest letting the animation play at the beginning of the level just to test whether it plays at all or not.
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: Making a Crashing Spaceship

Post by thelegend »

Maveritchell wrote:

Code: Select all

animateobja = OnObjectKill(
   function(object, killer)
      if GetEntityName(object) == "objectBnameinZeroEditor" then
         PlayAnimation("whateveranimationgroup")
      end
   end
)
In PlayAnimation I put the name of my group (Crash_2) and in "objectBnameinZeroEditor" I put the name of the first, un-animated Star Destroyer.
I have just disabled hierarchies but there is still no change.
Is there already a proper code that might help me?


By the way what does GetEntityName do?
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Making a Crashing Spaceship

Post by AQT »

thelegend wrote:Is there already a proper code that might help me?
What do you mean by "proper"?
By the way what does GetEntityName do?
As its name suggests and in the example Mav provided, it gets the name of the object in Zero Editor as a string of text. Not the ODF name, mind you.

Again, have you tried letting the animation play outside of this function? It's easier to pinpoint the issue when other factors are out of play. Is the animation not playing because there is something wrong with the animation itself or because there is something wrong with the function?

And the other thing to consider that you did not seem to address is:
AQT wrote:Also, is Star_Destroyer_2_B in another animation group that plays prior to "Crash_2" playing? Usually, when an object has already been animated, it can't be animated for a second time for a reason I have yet to pinpoint.
This question has nothing to do with the OnObjectKill function, by the way.
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: Making a Crashing Spaceship

Post by thelegend »

Alright. I have probably misunderstood your posts. I am sorry.
AQT wrote:What do you mean by "proper"?
I mean if there was already a code of text that uses an event similair to mine.
AQT wrote:...name of the object in Zero Editor as a string of text. Not the ODF name...
The ODF name is "Star_Destroyer". I placed it twice at the same location and called them Star_Destroyer_2_A (main prop, un-animated) and Star_Destroyer_2_B (Actually already destroyed [KillObject in .lua] and then respawned after the first Destroyer has been destroyed, but I kept this part out ).
AQT wrote:Again, have you tried letting the animation play outside of this function? It's easier to pinpoint the issue when other factors are out of play. Is the animation not playing because there is something wrong with the animation itself or because there is something wrong with the function?
Yes I have tried. I set "Play Animation when level starts" in Anim Mode and in-game the Crashing Animation worked fine.
AQT wrote:Also, is Star_Destroyer_2_B in another animation group that plays prior to "Crash_2" playing?
The name of the single crashing animation and of the animation group (which only contains this one single animation) is the same (Crash_2).

Code: Select all

PlayAnimation("whateveranimationgroup")
This says I must put the name of the group and not the single animation itself.

I am going to play around with the names.
And by the way here is a part of the .anm file only with the Crashing part:
Hidden/Spoiler:
[code]
Animation("Crash_2", 75.00, 0, 0)
{
AddPositionKey(0.00, 0.00, 0.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddPositionKey(5.00, 0.00, -20.00, 20.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddPositionKey(8.00, 0.00, -70.00, 65.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddPositionKey(65.00, 0.00, -600.00, 2800.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddPositionKey(75.00, 0.00, -710.00, 3100.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(0.00, 0.00, 0.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(5.00, 2.00, 0.00, -10.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(8.00, 5.00, 0.00, 5.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(65.00, -2.00, 8.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(75.00, 4.00, 6.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
}

AnimationGroup("Crash_2", 0, 0)
{
DisableHierarchies();
Animation("Crash_2", "Star_Destroyer_2_B");
}

[/code]
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Making a Crashing Spaceship

Post by AQT »

thelegend wrote:
AQT wrote:What do you mean by "proper"?
I mean if there was already a code of text that uses an event similair to mine.
Your code looks fine given that the name of the object to be destroyed and the animation group to be played are correct. Are you, however, using more than one OnObjectKill function in your lua? If you are, make sure they aren't using the same variable as each other (e.g. animateobja).
...Star_Destroyer_2_B (Actually already destroyed [KillObject in .lua] and then respawned after the first Destroyer has been destroyed, but I kept this part out ).
Does it have destroyed geometry? And when you tested the crashing animation with "Play Animation when level starts" enabled, was Star_Destroyer_2_B already destroyed?
AQT wrote:Also, is Star_Destroyer_2_B in another animation group that plays prior to "Crash_2" playing?
The name of the single crashing animation and of the animation group (which only contains this one single animation) is the same (Crash_2).
Let me rephrase this question: The only time Star_Destroyer_2_B gets animated at all in your map is during this crash sequence, right? As in, it wasn't animated to its location of death by another animation group? (I don't know, maybe you had the Star Destroyer fly a new location before being blown up.) In other words, if you open up your .anm file in Notepad and search for Star_Destroyer_2_B, how many times does it show up?
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: Making a Crashing Spaceship

Post by thelegend »

AQT wrote:Your code looks fine given that the name of the object to be destroyed and the animation group to be played are correct. Are you, however, using more than one OnObjectKill function in your lua? If you are, make sure they aren't using the same variable as each other (e.g. animateobja).
I only use one code for now. But I am going to add a few more (Of course all with other names).
AQT wrote:Does it have destroyed geometry? And when you tested the crashing animation with "Play Animation when level starts" enabled, was Star_Destroyer_2_B already destroyed?
None of the Destroyers have destroyed Geometries. I throught it was not so required. I can add them to to the odf and see what happens.
Star Destroyer_2_B has never been destroyed, but I killed Destroyer_2_A through a lua code. Now if Play "Animation when level starts" is disabled the animation group (Crash_2) doesn't start.
AQT wrote:In other words, if you open up your .anm file in Notepad and search for Star_Destroyer_2_B, how many times does it show up?
If I search for "Star_Destroyer_2_B" in my .anm file I only find it once.

I don't know if it helps but here are my .anm and .lua files (only until ScriptInit has been reached):
Hidden/Spoiler:
[code]
Animation("A_Droid_1", 94.00, 1, 0)
{
AddPositionKey(0.00, 0.00, 0.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddPositionKey(20.00, 0.00, 0.00, 18.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddPositionKey(22.00, 0.00, 0.00, 18.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddPositionKey(42.00, 25.00, 0.00, 18.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddPositionKey(44.00, 25.00, 0.00, 18.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddPositionKey(54.00, 25.00, 0.00, 9.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddPositionKey(56.00, 25.00, 0.00, 9.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddPositionKey(70.00, 12.00, 0.00, 9.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddPositionKey(72.00, 12.00, 0.00, 9.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddPositionKey(80.00, 12.00, 0.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddPositionKey(82.00, 12.00, 0.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddPositionKey(92.00, 0.00, 0.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddPositionKey(94.00, 0.00, 0.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(0.00, 0.00, 0.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(20.00, 0.00, 0.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(22.00, 0.00, 90.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(42.00, 0.00, 90.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(44.00, 0.00, 180.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(54.00, 0.00, 180.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(56.00, 0.00, 270.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(70.00, 0.00, 270.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(72.00, 0.00, 180.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(80.00, 0.00, 180.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(82.00, 0.00, 270.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(92.00, 0.00, 270.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(94.00, 0.00, 360.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
}

Animation("Crash_2", 75.00, 0, 0)
{
AddPositionKey(0.00, 0.00, 0.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddPositionKey(5.00, 0.00, -20.00, 20.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddPositionKey(8.00, 0.00, -70.00, 65.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddPositionKey(65.00, 0.00, -600.00, 2800.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddPositionKey(75.00, 0.00, -710.00, 3100.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(0.00, 0.00, 0.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(5.00, 2.00, 0.00, -10.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(8.00, 5.00, 0.00, 5.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(65.00, -2.00, 8.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
AddRotationKey(75.00, 4.00, 6.00, 0.00, 1, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00);
}

AnimationGroup("Mos_Eisley_Droids", 1, 0)
{
Animation("A_Droid_1", "r2d2_red");
}

AnimationGroup("Crash_2", 0, 0)
{
DisableHierarchies();
Animation("Crash_2", "Star_Destroyer_2_B");
}
[/code]
Hidden/Spoiler:
[code]
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveConquest")

-- Empire Attacking (attacker is always #1)
local ALL = 2
local IMP = 1
-- These variables do not change
local ATT = 1
local DEF = 2

function ScriptPostLoad()

KillObject("Star_Destroyer_2_A") --So I can see if the animation works, the first, static destroyer will be destroyed.


--SetProperty("Star_Destroyer_2_A", "MaxHealth", 1000)
--SetProperty("Star_Destroyer_2_A", "CurHealth", 1000) --both lines are test lines I'd use after the animation works.


AICanCaptureCP("cp1", 3, false)
AICanCaptureCP("cp2", 3, false)
AICanCaptureCP("cp3", 3, false)
AICanCaptureCP("cp4", 3, false)
AICanCaptureCP("cp5", 3, false)
AICanCaptureCP("cp6", 3, false)
AICanCaptureCP("cp7", 3, false)
AICanCaptureCP("cp8", 3, false)
AICanCaptureCP("cp9", 3, false)
AICanCaptureCP("cp10", 3, false)
AICanCaptureCP("Local_CP", 3, true)

AICanCaptureCP("cp1", 4, false)
AICanCaptureCP("cp2", 4, false)
AICanCaptureCP("cp3", 4, false)
AICanCaptureCP("cp4", 4, false)
AICanCaptureCP("cp5", 4, false)
AICanCaptureCP("cp6", 4, false)
AICanCaptureCP("cp7", 4, false)
AICanCaptureCP("cp8", 4, false)
AICanCaptureCP("cp9", 4, false)
AICanCaptureCP("cp10", 4, false)
AICanCaptureCP("Local_CP", 4, false)

AICanCaptureCP("cp1", 5, false)
AICanCaptureCP("cp2", 5, false)
AICanCaptureCP("cp3", 5, false)
AICanCaptureCP("cp4", 5, false)
AICanCaptureCP("cp5", 5, false)
AICanCaptureCP("cp6", 5, false)
AICanCaptureCP("cp7", 5, false)
AICanCaptureCP("cp8", 5, false)
AICanCaptureCP("cp9", 5, false)
AICanCaptureCP("cp10", 5, false)
AICanCaptureCP("Local_CP", 5, false)


animateobja = OnObjectKill(
function(object)
if GetEntityName(object) == "Star_Destroyer_2_A" then
--RespawnObject("Star_Destroyer_2_B") --Destroyer_2_B is still alive, so it should actually work, after Destroyer_2_A has been destroyed

PlayAnimation("Crash_2")
end
end
)





--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}
cp5 = CommandPost:New{name = "cp5"}
cp6 = CommandPost:New{name = "cp6"}
cp7 = CommandPost:New{name = "cp7"}
cp8 = CommandPost:New{name = "cp8"}
cp9 = CommandPost:New{name = "cp9"}
cp10 = CommandPost:New{name = "cp10"}
Local_CP = CommandPost:New{name = "Local_CP"}



--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true}

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)
conquest:AddCommandPost(cp5)
conquest:AddCommandPost(cp6)
conquest:AddCommandPost(cp7)
conquest:AddCommandPost(cp8)
conquest:AddCommandPost(cp9)
conquest:AddCommandPost(cp10)
conquest:AddCommandPost(Local_CP)

conquest:Start()
SetUberMode(1);
EnableSPHeroRules()

EnableFlyerPath(all_fly,1)
EnableFlyerPath(imp_fly,1)
end


---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------

[/code]
Thank you very much for your help AQT :D


Edit: There's another issue.
If I add the KillObject ('Destroyer B') into my .lua and then destroy 'Destroyer A' in-game 'Destroyer B' didn't respawn as I ordered it in the .lua. So I believe this piece of code is not right so far. But I am not sure.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Making a Crashing Spaceship

Post by AQT »

The reason I asked about the destroyed geometry was because you said you used KillObject on Star_Destroyer_2_B elsewhere in your lua, (which at the time didn't have a destroyed geometry) so it was technically invisible or not there at all. In your code, you commented out the line that respawns Star_Destroyer_2_B:
thelegend wrote:

Code: Select all

animateobja = OnObjectKill(
   function(object)
      if GetEntityName(object) == "Star_Destroyer_2_A" then
   --RespawnObject("Star_Destroyer_2_B")
         PlayAnimation("Crash_2")
      end
   end
)
So when the animation plays, there was nothing to animate (unless you already un-commented the respawn line and it's still not working).

The other thing to consider is whether your Star Destroyer object has a MaxHealth or not. If I remember correctly, RespawnObject doesn't work on objects with MaxHealth. Instead of RespawnObject, you would have to use SetProperty twice to reset both the CurHealth and MaxHealth of Star_Destroyer_2_B back to their original values. And just to play it safe, instead of using KillObject, use SetProperty once to set the CurHealth to 0. You will need to give the Star Destroyer object a destroyed geometry in this case.

Alternatively, you can make two ODFs, one for Star_Destroyer_2_A with MaxHealth and one for Star_Destroyer_2_B without the MaxHealth line. This way you can still use KillObject and RespawnObject.
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: Making a Crashing Spaceship

Post by thelegend »

Thank you but it is still not working. I tried another way to create a Crashing Spaceship in xsi. I animated a 2 frame idle animation and a 1800 frame Death animation+the basepose.msh. Both exported as animated meshes and as a basepose. I already made a door and an animated object. Both successful. But now the game crashes after loading (Before the map even starts).
I removed all the "Crashing" event lines from my .lua and renamed the placed object to Star_Destroyer_2.

Object's odf:
Hidden/Spoiler:
[code][GameObjectClass]

ClassLabel = "BuildingAnimatedArmed"
GeometryName = "Star_Destroyer.msh"


[Properties]

GeometryName = "Star_Destroyer"
CollisionScale = 100.0


MaxHealth = "2000.0"
ExplosionName = "spa_prop_frigate_destruct_exp"


DestroyedGeometryName = ""

AnimationName ="Star_Destroyer"
IdleAnimation ="idle"
DeathAnimation ="destroy"

//EnableDeathExplosions = "1"


MapTexture = ""
MapScale = ""
RemoveFromMapWhenDead = "1"

FoleyFXGroup = "metal_foley"[/code]
The classlabel had been destructablebuilding and animatedbuilding too.

I still keep the funtion itself in mind, but I believe using DeathAnimation in my odf works a little bit better.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Making a Crashing Spaceship

Post by AQT »

thelegend wrote:Thank you but it is still not working.
Are you sure you did it correctly? I have no way of knowing.

Why are you using the ClassLabel BuildingAnimatedArmed now? Also, I'm pretty sure the following will cause issues:

Code: Select all

DestroyedGeometryName       = ""
Either provide a name for an actual .msh file or remove the line complete.

Alright, don't do the death animations any further until you have tried this. Use the following for your Star Destroyer's ODF:
Hidden/Spoiler:
[code][GameObjectClass]

ClassLabel = "destructablebuilding"
GeometryName = "Star_Destroyer.msh"


[Properties]

GeometryName = "Star_Destroyer"
DestroyedGeometryName = "use_a_small_invisible_model_with_no_collision"

ExplosionName = "spa_prop_frigate_destruct_exp"

AINoRepair = "1"
MaxHealth = "2000.0"

FoleyFXGroup = "metal_foley"[/code]
And delete all the lines you currently have in your lua related to this crashing event, and replace them with the following:
Hidden/Spoiler:
[code]
--Use the following lines to kill "Star_Destroyer_2_A" to test the function
--but I suggest killing it with a bomber or something
--SetProperty("Star_Destroyer_2_A", "CurHealth", 0)
--SetProperty("Star_Destroyer_2_A", "MaxHealth", 1e+37)

--Makes "Star_Destroyer_2_B" disappear, collision-less, and irreparable for now
SetProperty("Star_Destroyer_2_B", "IsVisible", 0)
SetProperty("Star_Destroyer_2_B", "CurHealth", 0)
SetProperty("Star_Destroyer_2_B", "MaxHealth", 1e+37)

animateobja = OnObjectKill(
function(object)
if GetEntityName(object) == "Star_Destroyer_2_A" then
SetProperty("Star_Destroyer_2_B", "IsVisible", 1)
SetProperty("Star_Destroyer_2_B", "CurHealth", 1e+37)
SetProperty("Star_Destroyer_2_B", "MaxHealth", 1e+37)
PlayAnimation("Crash_2")
end
end
)[/code]
Now, if this doesn't work for whatever reason, you probably went ahead and did something extra on the side without mentioning it.
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: Making a Crashing Spaceship

Post by thelegend »

Ok I am going to follow your instructions sooner. I will reply back if it works or not and thank you very much for taking time with this.

Edit: Alright. I did everything step for step (Except of making that invible, collision-less cube invisible and collision-less, because I think this wouldn't affect the event).
But Star_Destroyer_2_B doesn't appear after I used your written codes. I again added 2 Objects, called them Star_Destroyer_2_A and [...]_2_B.
I can post/upload the objects and animations only and maybe you (or anybody else) can test them out.

http://www.mediafire.com/download/x77ou ... mation.rar
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Making a Crashing Spaceship

Post by AQT »

Can you please post your updated lua too? :o
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: Making a Crashing Spaceship

Post by thelegend »

AQT wrote:Can you please post your updated lua too? :o
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
-- Tatooine At War by the_legend

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveConquest")

-- Empire Attacking (attacker is always #1)
local ALL = 2
local IMP = 1
-- These variables do not change
local ATT = 1
local DEF = 2

function ScriptPostLoad()


AICanCaptureCP("cp1", 3, false)
AICanCaptureCP("cp2", 3, false)
AICanCaptureCP("cp3", 3, false)
AICanCaptureCP("cp4", 3, false)
AICanCaptureCP("cp5", 3, false)
AICanCaptureCP("cp6", 3, false)
AICanCaptureCP("cp7", 3, false)
AICanCaptureCP("cp8", 3, false)
AICanCaptureCP("cp9", 3, false)
AICanCaptureCP("cp10", 3, false)
AICanCaptureCP("Local_CP", 3, true)

AICanCaptureCP("cp1", 4, false)
AICanCaptureCP("cp2", 4, false)
AICanCaptureCP("cp3", 4, false)
AICanCaptureCP("cp4", 4, false)
AICanCaptureCP("cp5", 4, false)
AICanCaptureCP("cp6", 4, false)
AICanCaptureCP("cp7", 4, false)
AICanCaptureCP("cp8", 4, false)
AICanCaptureCP("cp9", 4, false)
AICanCaptureCP("cp10", 4, false)
AICanCaptureCP("Local_CP", 4, false)

AICanCaptureCP("cp1", 5, false)
AICanCaptureCP("cp2", 5, false)
AICanCaptureCP("cp3", 5, false)
AICanCaptureCP("cp4", 5, false)
AICanCaptureCP("cp5", 5, false)
AICanCaptureCP("cp6", 5, false)
AICanCaptureCP("cp7", 5, false)
AICanCaptureCP("cp8", 5, false)
AICanCaptureCP("cp9", 5, false)
AICanCaptureCP("cp10", 5, false)
AICanCaptureCP("Local_CP", 5, false)



--Use the following lines to kill "Star_Destroyer_2_A" to test the function
--but I suggest killing it with a bomber or something
SetProperty("Star_Destroyer_2_A", "CurHealth", 0)
SetProperty("Star_Destroyer_2_A", "MaxHealth", 1e+37)

--Makes "Star_Destroyer_2_B" disappear, collision-less, and irreparable for now
SetProperty("Star_Destroyer_2_B", "IsVisible", 0)
SetProperty("Star_Destroyer_2_B", "CurHealth", 0)
SetProperty("Star_Destroyer_2_B", "MaxHealth", 1e+37)

animateobja = OnObjectKill(
function(object)
if GetEntityName(object) == "Star_Destroyer_2_A" then
SetProperty("Star_Destroyer_2_B", "IsVisible", 1)
SetProperty("Star_Destroyer_2_B", "CurHealth", 1e+37)
SetProperty("Star_Destroyer_2_B", "MaxHealth", 1e+37)
-- PlayAnimation("Crash_2")
end
end
)


--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}
cp5 = CommandPost:New{name = "cp5"}
cp6 = CommandPost:New{name = "cp6"}
cp7 = CommandPost:New{name = "cp7"}
cp8 = CommandPost:New{name = "cp8"}
cp9 = CommandPost:New{name = "cp9"}
cp10 = CommandPost:New{name = "cp10"}
Local_CP = CommandPost:New{name = "Local_CP"}



--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true}

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)
conquest:AddCommandPost(cp5)
conquest:AddCommandPost(cp6)
conquest:AddCommandPost(cp7)
conquest:AddCommandPost(cp8)
conquest:AddCommandPost(cp9)
conquest:AddCommandPost(cp10)
conquest:AddCommandPost(Local_CP)

conquest:Start()
SetUberMode(1);
EnableSPHeroRules()
AddDeathRegion("Deathregion1")
EnableFlyerPath(all_fly,1)
EnableFlyerPath(imp_fly,1)
end


---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------


function ScriptInit()
ReadDataFile("dc:ingame.lvl")
ReadDataFile("ingame.lvl")
ReadDataFile("dc:bmpKill.lvl")



SetMaxFlyHeight(2500)
SetMaxPlayerFlyHeight(2500)


SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo

ReadDataFile("dc:sound\\taw.lvl;taw_gcw")
ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("dc:SIDE\\all.lvl",
"all_inf_rifleman",
"all_inf_rocketeer",
"all_inf_sniper",
"all_inf_engineer",
"all_inf_officer",
"all_inf_pilot",
"all_inf_wookiee",
"all_hero_hansolo_tat",
"all_hero_luke_jedi",
"all_hover_combatspeeder",
"all_fly_awing",
"all_fly_ywing_sc",
"all_fly_xwing_sc",
"all_inf_special")

ReadDataFile("dc:SIDE\\imp.lvl",
"imp_inf_rifleman",
"imp_inf_rocketeer",
"imp_inf_engineer",
"imp_inf_sniper",
"imp_inf_officer",
"imp_inf_pilot",
"imp_inf_dark_trooper",
"imp_hero_bobafett",
"imp_hero_darthvader",
"imp_walk_atst",
"imp_hover_fightertank",
"imp_hover_speederbike",
"imp_fly_tiefighter_sc",
"imp_fly_tiebomber_sc",
"imp_fly_tieinterceptor",
"imp_inf_shock_trooper" )

ReadDataFile("dc:SIDE\\des.lvl",
"tat_inf_jawa",
"tat_inf_tuskenhunter",
"tat_inf_tuskenraider",
"tat_hover_skiff" )

ReadDataFile("dc:SIDE\\gam.lvl",
"gam_inf_gamorreanguard" )

ReadDataFile("dc:SIDE\\tur.lvl",
"tur_bldg_laser",
"tur_bldg_chaingun",
"tur_bldg_beam",
"tur_bldg_recoilless_kas")

SetupTeams{
all = {
team = ALL,
units = 55,
reinforcements = 500,
soldier = { "all_inf_rifleman",10, 15},
assault = { "all_inf_rocketeer",5,10},
engineer = { "all_inf_engineer",5,10},
sniper = { "all_inf_sniper",5,10},
pilot = { "all_inf_pilot",2,5},
officer = { "all_inf_officer",1,5},
special1 = { "all_inf_special",3,5},
hero = { "all_hero_hansolo_tat",0,1},

},
imp = {
team = IMP,
units = 55,
reinforcements = 500,
soldier = { "imp_inf_rifleman",10, 15},
assault = { "imp_inf_rocketeer",5,10},
engineer = { "imp_inf_engineer",5,10},
sniper = { "imp_inf_sniper",5,10},
pilot = { "imp_inf_pilot",2,5},
officer = { "imp_inf_officer",1,5},
special1 = { "imp_inf_shock_trooper",3,5},
hero = { "imp_hero_bobafett",0,1},
},
}


SetTeamName (3, "DES")
AddUnitClass (3, "tat_inf_tuskenraider", 4,5)
AddUnitClass (3, "tat_inf_tuskenhunter", 4,5)
SetUnitCount (3, 10)
AddAIGoal(3, "Deathmatch", 100)


SetTeamName (4, "GAM")
AddUnitClass (4, "gam_inf_gamorreanguard", 1,2)
SetUnitCount (4, 2)
AddAIGoal(4, "Deathmatch", 100)


SetTeamName (5, "DES")
AddUnitClass (5, "tat_inf_jawa", 15,22)
SetUnitCount (5, 22)
AddAIGoal(5, "Deathmatch", 100)


SetTeamAsFriend(ATT,5)
SetTeamAsFriend(5,ATT)
SetTeamAsFriend(DEF,5)
SetTeamAsFriend(5,DEF)

SetTeamAsEnemy(ATT,3)
SetTeamAsEnemy(3,ATT)
SetTeamAsEnemy(DEF,3)
SetTeamAsEnemy(3,DEF)

SetTeamAsEnemy(ATT,4)
SetTeamAsEnemy(4,ATT)
SetTeamAsEnemy(DEF,4)
SetTeamAsEnemy(4,DEF)


SetTeamAsEnemy(4,3)
SetTeamAsEnemy(3,4)

SetTeamAsEnemy(5,3)
SetTeamAsEnemy(3,5)

SetTeamAsEnemy(3,5)
SetTeamAsEnemy(5,3)


SetHeroClass(ALL, "all_hero_luke_jedi")
SetHeroClass(IMP, "imp_hero_darthvader")

-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- special -> droidekas
AddWalkerType(1, 4) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)

local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:TAW\\TAW.lvl", "TAW_conquest", "TAW_Clouds")
SetDenseEnvironment("false")


-- Sound Stats

voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "des_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "all_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_quick", voiceQuick)


OpenAudioStream("sound\\global.lvl", "gcw_music")
-- OpenAudioStream("dc:sound\\taw.lvl")
OpenAudioStream("sound\\tat.lvl", "tat2")
OpenAudioStream("sound\\tat.lvl", "tat2")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")

SetBleedingVoiceOver(ALL, ALL, "all_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(ALL, IMP, "all_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, ALL, "imp_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, IMP, "imp_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(ALL, ALL, "all_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(ALL, IMP, "all_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(IMP, IMP, "imp_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(IMP, ALL, "imp_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(2, "Allleaving")
SetOutOfBoundsVoiceOver(1, "Impleaving")

SetAmbientMusic(ALL, 1.0, "all_tat_amb_start", 0,1)
SetAmbientMusic(ALL, 0.8, "all_tat_amb_middle", 1,1)
SetAmbientMusic(ALL, 0.2, "all_tat_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "imp_tat_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "imp_tat_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2, "imp_tat_amb_end", 2,1)

SetVictoryMusic(ALL, "all_tat_amb_victory")
SetDefeatMusic (ALL, "all_tat_amb_defeat")
SetVictoryMusic(IMP, "imp_tat_amb_victory")
SetDefeatMusic (IMP, "imp_tat_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("WeaponUnableSelect", "com_weap_inf_weaponchange_null")
--SetSoundEffect("WeaponModeUnableSelect", "com_weap_inf_modechange_null")
SetSoundEffect("SpawnDisplayUnitChange", "shell_select_unit")
SetSoundEffect("SpawnDisplayUnitAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplaySpawnPointChange", "shell_select_change")
SetSoundEffect("SpawnDisplaySpawnPointAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplayBack", "shell_menu_exit")

SetAttackingTeam(ATT)

-- Camera Stats
-- Mos Eisley
AddCameraShot(0.997189, -0.057529, 0.047923, 0.002765, -242.154282, 123.914772, 206.124817);

end
[/code]
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Making a Crashing Spaceship

Post by AQT »

New lines to replace the old ones:

Code: Select all

--Don't use these lines, but instead kill "Star_Destroyer_2_A" using a unit/vehicle
--SetProperty("Star_Destroyer_2_A", "CurHealth", 0)
--SetProperty("Star_Destroyer_2_A", "MaxHealth", 1e+37)

--Makes "Star_Destroyer_2_B" disappear, collision-less, and irreparable for now
   SetProperty("Star_Destroyer_2_B", "IsVisible", 0)
   SetProperty("Star_Destroyer_2_B", "CurHealth", 0)
   SetProperty("Star_Destroyer_2_B", "MaxHealth", 1e+37)

animateobja = OnObjectKill(
   function(object, killer)
      if GetEntityName(object) == "Star_Destroyer_2_A" then
         SetProperty("Star_Destroyer_2_B", "IsVisible", 1)
       SetProperty("Star_Destroyer_2_B", "CurHealth", 1e+37)
       SetProperty("Star_Destroyer_2_B", "MaxHealth", 1e+37)
       PlayAnimation("Crash_2")
      end
   end
)
We had function(object) instead of function(object, killer). I was originally working off of the function you edited and apparently overlooked this part. Also, not sure why the PlayAnimation line was commented out. Also, killing the an object via lua might not really count as the object being killed by another entity. You should at least test this out by killing the Star Destroyer using a unit or vehicle.
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: Making a Crashing Spaceship

Post by thelegend »

I would like to know what's the difference beetween those two functions.

Anyway there is still no result. I have tested the animation in ZeroEditor, used PlayAnimation as a normal code to look if the animation will also work through my lua; I commented out some lines and not but the actual problem is that Star_Destroyer_2_B doesn't respawn (Or better said doesn't appear again) anymore, after it has been became invisble, weak etc. I am sure the animation would work but only if Object (2_B) appears in-game again.
Hidden/Spoiler:
[code]--Don't use these lines, but instead kill "Star_Destroyer_2_A" using a unit/vehicle
--SetProperty("Star_Destroyer_2_A", "CurHealth", 0)
--SetProperty("Star_Destroyer_2_A", "MaxHealth", 1e+37)

--Makes "Star_Destroyer_2_B" disappear, collision-less, and irreparable for now
SetProperty("Star_Destroyer_2_B", "IsVisible", 0)
SetProperty("Star_Destroyer_2_B", "CurHealth", 0)
SetProperty("Star_Destroyer_2_B", "MaxHealth", 1e+37)

animateobja = OnObjectKill(
function(object, killer)
if GetEntityName(object) == "Star_Destroyer_2_A" then
SetProperty("Star_Destroyer_2_B", "IsVisible", 1)
SetProperty("Star_Destroyer_2_B", "CurHealth", 1e+37)
SetProperty("Star_Destroyer_2_B", "MaxHealth", 1e+37)
-- PlayAnimation("Crash_2")
end
end
)[/code]
This is how I let it look like now. I first want to test if Star_Destroyer_2_B appears back. But this doesn't happen.

By the way did the event work for you if you have tried it out?
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Making a Crashing Spaceship

Post by AQT »

thelegend wrote:I would like to know what's the difference beetween those two functions.
OnObjectKill is a function that depends on two parameters, an object and a killer. I did not catch the mistake when you originally posted:
thelegend wrote:

Code: Select all

animateobja = OnObjectKill(
   function(object)
      if GetEntityName(object) == "Star_Destroyer_2_A" then
   --RespawnObject("Star_Destroyer_2_B")
         PlayAnimation("Crash_2")
      end
   end
)
And that was the code I was working off of. Why did you remove the killer part in the first place?

Anywho, after several minutes of fiddling around, I found that the following should work for certain now:

Code: Select all

--Makes "Star_Destroyer_2_B" disappear, collision-less, and irreparable for now
   SetProperty("star_destroyer_2_b", "IsVisible", 0)
   SetProperty("star_destroyer_2_b", "CurHealth", 0)
   SetProperty("star_destroyer_2_b", "MaxHealth", 1e+37)

animateobja = OnObjectKill(
   function(object, killer)
      if GetEntityName(object) == "star_destroyer_2_a" then
         SetProperty("star_destroyer_2_b", "IsVisible", 1)
       SetProperty("star_destroyer_2_b", "CurHealth", 1e+37)
       SetProperty("star_destroyer_2_b", "MaxHealth", 1e+37)
       PlayAnimation("crash_2")
      end
   end
)
The OnObjectKill function itself wasn't working because when this condition is checked:

Code: Select all

if GetEntityName(object) == "star_destroyer_2_a"
The lua considers "star_destroyer_2_a" and "Star_Destroyer_2_A" to be two different names. It seems ZE is not case-sensitive... :|

I personally haven't used capital letters for object names before, so the thought didn't really occur to me at first. But in the end, there was a logical explanation after all...
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: Making a Crashing Spaceship

Post by thelegend »

Yeah. That was it. The letters had to be small. I always used capital letters if I have written them as capitals. It has worked for several other codes. Anyway it works now. The second destroyer apperas again and even plays the animation without any problems. Sir, you are my hero :bowdown:
Post Reply