Hi guys,
Watchin' this few days ago, made by Noobsaurus.
www.youtube.com/watch?v=NDfQZfWx0oo
But I can't be able to reproduce this with some piece of lua. I dont know how to get the character unit id for powerup station, supposing it has a meaning for them. So because of that, I cant use SetEntityMatrix as I would with my player. CreateEntity does not work either for spawning new ammo/medical droid. How does he manage to do that, any idea?
Thanks in advance.
How to move dynamically powerup stations
Moderator: Moderators
-
Plaigon
- Recruit Womprat Killer
- Posts: 13
- Joined: Fri Dec 14, 2018 6:22 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
-
kiprobin
- First Lance Corporal

- Posts: 120
- Joined: Wed Dec 11, 2019 3:52 pm
- Projects :: Trench War
- xbox live or psn: No gamertag set
Re: How to move dynamically powerup stations
I think the Hera Syndulla that Teancum converted had a weapon odf that would deploy chopper in a similar way that the storm trooper in the vid deploys the medical droid. You could set it up as a weapon odf and then have the medical droid as the so called ordinance. The snipers auto turret may work the same way, I think. Worth a shot at least
- Teancum
- Jedi Admin

- Posts: 11080
- Joined: Wed Sep 07, 2005 11:42 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Indiana
Re: How to move dynamically powerup stations
Huh, I guess that would work. I was asked about this the other day and didn't think about deployables. But there's still the issue of destroying the old one to give the appearance of it teleporting. Not entirely sure what the end goal here is.
- Benoz
- Corporal

- Posts: 142
- Joined: Tue May 28, 2013 12:34 pm
- Projects :: Clone Wars Era Mod Version 2
- xbox live or psn: No gamertag set
- Location: Germany
Re: How to move dynamically powerup stations
That would easily be fixed. When you give your healthdroid the ClassLabel = "dispenser" and add the value TriggerAll = "1" it destroys the droid before creating a new one. Just like with the auto turret.
- Teancum
- Jedi Admin

- Posts: 11080
- Joined: Wed Sep 07, 2005 11:42 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Indiana
Re: How to move dynamically powerup stations
Hmm, just realized this might be great for a deployable cover system
-
MileHighGuy
- Jedi

- Posts: 1194
- Joined: Fri Dec 19, 2008 7:58 pm
Re: How to move dynamically powerup stations
No need to destroy the object. Try something like this in your LUA in ScriptInit. Obviously put the right ODF names in there.
I am not sure if it works with a 0 damage weapon. Hopefully the code works, I haven't tested it. If it doesnt work there is a typo, the idea is totally doable.
Code: Select all
--damager is you
--object is the thing being damaged
moveObject = OnObjectDamage(
function(object, damager)
if damager == nil then
return
end
local unit = GetCharacterUnit(damager)
if GetObjectLastHitWeaponClass(object) == "MY_WEAPON_ODF"
and GetEntityClassName(object) == "HEALTH_DROID_ODF"
and unit ~= nil then
--move the object 3 units in front of you
local newMatrix = CreateMatrix(0,0,0,0,0,0,3, GetEntityMatrix(GetCharacterUnit(damager))
SetEntityMatrix(object , newMatrix)
end
end
)