Page 1 of 2
Lasers Deploying Turrets
Posted: Mon Apr 18, 2011 8:08 am
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)
Re: Lasers Deploying Turrets
Posted: Mon Apr 18, 2011 8:14 am
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.
Re: Lasers Deploying Turrets
Posted: Mon Apr 18, 2011 8:21 am
by Lagomorphia
Trying to make an air drop, so I need the turret to spawn convincingly high and then fall down.
Re: Lasers Deploying Turrets
Posted: Mon Apr 18, 2011 8:36 am
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.
Re: Lasers Deploying Turrets
Posted: Mon Apr 18, 2011 8:38 am
by Lagomorphia
You keep talking about this matrix thing and I have no idea what it is.

Re: Lasers Deploying Turrets
Posted: Mon Apr 18, 2011 9:07 am
by DarthD.U.C.K.
yeah, too bad
Re: Lasers Deploying Turrets
Posted: Mon Apr 18, 2011 9:08 am
by Lagomorphia
If it involves ZeroEditor I won't be able to use it here.
Re: Lasers Deploying Turrets
Posted: Mon Apr 18, 2011 9:16 am
by Fiodis
It's a LUA thing. You won't need ZE.
Re: Lasers Deploying Turrets
Posted: Mon Apr 18, 2011 9:53 am
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
Re: Lasers Deploying Turrets
Posted: Mon Apr 18, 2011 10:03 am
by Lagomorphia
I'll try that out shortly and report back on what happens.
Re: Lasers Deploying Turrets
Posted: Mon Apr 18, 2011 10:45 am
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.
Re: Lasers Deploying Turrets
Posted: Mon Apr 18, 2011 10:58 am
by Lagomorphia
Not sure I understand.
Re: Lasers Deploying Turrets
Posted: Mon Apr 18, 2011 12:26 pm
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.
Re: Lasers Deploying Turrets
Posted: Mon Apr 18, 2011 12:48 pm
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?
Re: Lasers Deploying Turrets
Posted: Mon Apr 18, 2011 1:06 pm
by Dakota
i wonder if we could set the orbital strike odf up to be a dispenser... i'll have to test that later.
Re: Lasers Deploying Turrets
Posted: Mon Apr 18, 2011 1:46 pm
by Lagomorphia
Already tried setting the beacon ordnance as a dispenser, and it failed.
Re: Lasers Deploying Turrets
Posted: Mon Apr 18, 2011 9:17 pm
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)
Re: Lasers Deploying Turrets
Posted: Mon Apr 18, 2011 10:19 pm
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?
Re: Lasers Deploying Turrets
Posted: Mon Apr 18, 2011 10:37 pm
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:
Re: Lasers Deploying Turrets
Posted: Tue Apr 19, 2011 12:28 am
by AQT
CalvaryCptMike wrote:Couldn't you just make the ThrowStrength really strong...
ThrowStrength does not exist, but there are Range and Velocity.