Opened 6 years ago

Closed 6 years ago

#966 closed enhancement (cantfix)

ProjectileDestroyed widget side callin

Reported by: beherith Owned by:
Priority: minor Milestone: BAR Beta release
Component: BAR Version:
Keywords: Cc:


ProjectileDestroyed is only called in gadgets, but I would like to add a small deferred light flash to it. If its not too much trouble, can the projectiledestroyed callin be somehow passed over to the widget? Im aware that it needs Script.SetWatchWeapon activated, and I can handle that part, along with all visibility and LOS checks needed to avoid leaking synced info to unsynced side.

Attachments (2)

api_projectile_destroyed.lua (1.3 KB ) - added by Bluestone 6 years ago.
gadget part
api_projectile_destroyer_reciever_example.lua (727 bytes ) - added by Bluestone 6 years ago.
widget part

Download all attachments as: .zip

Change History (9)

by Bluestone, 6 years ago

gadget part

by Bluestone, 6 years ago

widget part

comment:1 by Bluestone, 6 years ago

Here are the bare bones of what's needed, with no LOS masks or anything.

I'm quite cagey about doing this. I think there could be a significant performance cost - the 'callin' has to be passed from gadget synced -> gadget unsynced -> widget, and will be called very many times. There might also be a performance cost attached, inside the engine, to just watching all weapons.

Last edited 6 years ago by Bluestone (previous) (diff)

comment:2 by beherith, 6 years ago

Yeah, i totally understand your reservations on this, ill try to limit it to only the very very largest projectiles, namely t2 plasma cannons, and vlaunch missiles, and rockets.

Also, I will attempt to filter the stuff to only projectiles that are destroyed while in LOS and in view.

Thanks a ton, ill integrate it :D

comment:3 by beherith, 6 years ago

Is Spring.isSphereInView even callable from synced? Well ill have to try :D

comment:4 by Bluestone, 6 years ago

It should be callable from unsynced gadget but not synced gadget! LOS masking has to be done in unsynced gadget afaics.

One other thing - iirc Script.LuaUI calls can only have one widgetHandler:RegisterGlobal set as its reciever. So if you're going to put the reciever into a widget you'll need to remove the example widget.

Last edited 6 years ago by Bluestone (previous) (diff)

comment:5 by beherith, 6 years ago

Ok, I gave it a test, and unfortunately, it neither looks good enough, and doesnt perform well enough to give nice projectile flashes :(

comment:6 by Bluestone, 6 years ago

I think the only way to do this would be to add LuaUI version of Projectile* callins with appropriate los masking in the engine. I'm not sure why it wan't done already...

comment:7 by Bluestone, 6 years ago

Resolution: cantfix
Status: newclosed
Note: See TracTickets for help on using tickets.