Lasers Deploying Turrets

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

User avatar
Lagomorphia
Major
Major
Posts: 502
Joined: Sun Dec 13, 2009 10:02 am

Lasers Deploying Turrets

Post by Lagomorphia »

I've been trying to get deployables (in this case an autoturret) to spawn very high up and drop down. The only way I've found to offset the location something spawns when a unit uses it is to deploy it from an orbital strike. The orbital strike beacon, however, will not spawn a deployable, but it will spawn a bolt. I know you can spawn units from launching a recon droid using LUA coding. Is it possible to LUA code so that when the laser below spawns an autoturret spawns with it? Also, will the autoturret then fall to the ground as normal?

Laser ODF (cis_weap_deployer_ord)
Hidden/Spoiler:
[OrdnanceClass]
ClassLabel = "bolt"


[Properties]
ExplosionName = ""
LaserTexture = ""
//ImpactEffect = ""
LaserLength = ""
LaserWidth = ""
LaserGlowColor = ""
LightColor = ""
LightRadius = ""

LifeSpan = "1.0"
Velocity = "0.0"
Gravity = "0.0"
Rebound = "0.0"

MaxDamage = "0.0"

VehicleScale = "1.0"
PersonScale = "1.0"
DroidScale = "1.0"
BuildingScale = "1.0"
AnimalScale = "1.0"
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Lasers Deploying Turrets

Post by DarthD.U.C.K. »

no, you wont be able to do that, atleast not directly. the reason why you can spawn units when an autoturret is deployed is that you can check whether a dispenserweapon and only a dispenserweapon was used via lua.
you could however probably offset the matrix of the autoturret when its deployed so its higher up, but im not sure, i never did anything with matrixes.
User avatar
Lagomorphia
Major
Major
Posts: 502
Joined: Sun Dec 13, 2009 10:02 am

Re: Lasers Deploying Turrets

Post by Lagomorphia »

Trying to make an air drop, so I need the turret to spawn convincingly high and then fall down.
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Lasers Deploying Turrets

Post by Fiodis »

It's perfectly possible to teleport the turret to a higher matrix directly after it's spawned. I'm not sure if it would fall down though; do turrets follow unit/vehicle "physics"?

You'd run into trouble when trying to use it indoors or under a protrusion, also.
User avatar
Lagomorphia
Major
Major
Posts: 502
Joined: Sun Dec 13, 2009 10:02 am

Re: Lasers Deploying Turrets

Post by Lagomorphia »

You keep talking about this matrix thing and I have no idea what it is. :(
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Lasers Deploying Turrets

Post by DarthD.U.C.K. »

yeah, too bad :(
Hidden/Spoiler:
a matrix is a position in the world, you can take an object and teleport it to a certain matrix, cooking a hypothetical code now...
User avatar
Lagomorphia
Major
Major
Posts: 502
Joined: Sun Dec 13, 2009 10:02 am

Re: Lasers Deploying Turrets

Post by Lagomorphia »

If it involves ZeroEditor I won't be able to use it here.
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Lasers Deploying Turrets

Post by Fiodis »

It's a LUA thing. You won't need ZE.
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Lasers Deploying Turrets

Post by DarthD.U.C.K. »

my guess would be that:

Code: Select all

	Turret = "change_ord"
	Dropturret = = OnCharacterDispenseControllable(
		function(player,controllable)
			if GetEntityClass(controllable) == GetEntityClassPtr(Turret) then
				SetEntityMatrix(controllable, CreateMatrix(0.0, 0.0, 0.0, 0.0, 100.0, 0.0, 0.0, GetEntityMatrix(controllable))) --teleports the turret 100 metres in the air
			end
		end
	)
i used firefangs disguisekit-code as base
User avatar
Lagomorphia
Major
Major
Posts: 502
Joined: Sun Dec 13, 2009 10:02 am

Re: Lasers Deploying Turrets

Post by Lagomorphia »

I'll try that out shortly and report back on what happens.
User avatar
Dakota
Field Commander
Field Commander
Posts: 991
Joined: Mon Dec 06, 2010 8:21 pm
Projects :: making random weapon assets
Games I'm Playing :: SWBF2 and more
xbox live or psn: PS3 beats xbox
Location: at a computer desk floating around in space

Re: Lasers Deploying Turrets

Post by Dakota »

hmm i would think that just changing the ordanance would to the autoturret itself would make it work, i haven't tryed it with auto turrets but i have with rockets and various other bullets.
User avatar
Lagomorphia
Major
Major
Posts: 502
Joined: Sun Dec 13, 2009 10:02 am

Re: Lasers Deploying Turrets

Post by Lagomorphia »

Not sure I understand.
User avatar
Dakota
Field Commander
Field Commander
Posts: 991
Joined: Mon Dec 06, 2010 8:21 pm
Projects :: making random weapon assets
Games I'm Playing :: SWBF2 and more
xbox live or psn: PS3 beats xbox
Location: at a computer desk floating around in space

Re: Lasers Deploying Turrets

Post by Dakota »

well i just copy the auto turret.odf and then i go to the ordanence of the orbital then i delete all of that and then paste the auto turret odf words in its place. i always keep a back up of both files in case of problems.
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Lasers Deploying Turrets

Post by DarthD.U.C.K. »

the problem is that entitys such as turrets, mines etc. can only be deployed with dispensers, if you could do that with any weapon, it would defeat the purpose of dispensers, right?
User avatar
Dakota
Field Commander
Field Commander
Posts: 991
Joined: Mon Dec 06, 2010 8:21 pm
Projects :: making random weapon assets
Games I'm Playing :: SWBF2 and more
xbox live or psn: PS3 beats xbox
Location: at a computer desk floating around in space

Re: Lasers Deploying Turrets

Post by Dakota »

i wonder if we could set the orbital strike odf up to be a dispenser... i'll have to test that later.
User avatar
Lagomorphia
Major
Major
Posts: 502
Joined: Sun Dec 13, 2009 10:02 am

Re: Lasers Deploying Turrets

Post by Lagomorphia »

Already tried setting the beacon ordnance as a dispenser, and it failed.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Lasers Deploying Turrets

Post by [RDH]Zerted »

1) You need the player to use a weapon or do an action that triggers a Lua event callback. It doesn't matter if it's a deployable event, an object destruction of a recon droid, or something else. Use whatever fits your map best.
2.1) If that weapon dispenses a turret, teleport it into the sky. Units fall when teleported into the air so I would assume the turret falls as well.
2.2) If that weapon or action doesn't dispense a turret, use CreateEntity() to make one at a matrix offset into the sky. You could offset from the character's position (matrix), from the recon droid's last position, or whatever.

Did that help?

(This is how to do it through Lua, I would't know how/if it could be done though an OFD change)
CalvaryCptMike
Captain
Captain
Posts: 476
Joined: Sat Feb 19, 2011 3:10 pm
Projects :: Nothing--absolutely nothing
Location: Freed by alien robots, now living on Mars
Contact:

Re: Lasers Deploying Turrets

Post by CalvaryCptMike »

Couldn't you just make the ThrowStrength really strong and then add the ShotElevate to 90 degrees(straight up)? :? Wouldn't that make it fly up and then fall down like you wanted?
User avatar
Dakota
Field Commander
Field Commander
Posts: 991
Joined: Mon Dec 06, 2010 8:21 pm
Projects :: making random weapon assets
Games I'm Playing :: SWBF2 and more
xbox live or psn: PS3 beats xbox
Location: at a computer desk floating around in space

Re: Lasers Deploying Turrets

Post by Dakota »

CalvaryCptMike wrote:Couldn't you just make the ThrowStrength really strong and then add the ShotElevate to 90 degrees(straight up)? :? Wouldn't that make it fly up and then fall down like you wanted?
hmm out of all of us we were thinking something more complicated... but...
THAT IS PERFECT!!!

:themoreyouknow:
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Lasers Deploying Turrets

Post by AQT »

CalvaryCptMike wrote:Couldn't you just make the ThrowStrength really strong...
ThrowStrength does not exist, but there are Range and Velocity.
Post Reply