Sliders

Everything about mods can be found here.

Moderator: Morax

Sliders

Postby Resin_Smoker » 09 Jan 2015, 23:49

Anyone know if a slider can be based off of a projectile or prop?

So far i've only seen sliders used from a unit to move other things or stuff like muzzles.

Resin
Resin_Smoker
Evaluator
 
Posts: 858
Joined: 14 Mar 2012, 17:58
Has liked: 54 times
Been liked: 106 times

Re: Sliders

Postby Domino » 08 Feb 2015, 12:18

what do you mean give an example of what you want to happen.
Domino
Priest
 
Posts: 315
Joined: 14 Mar 2012, 21:07
Has liked: 3 times
Been liked: 75 times

Re: Sliders

Postby Resin_Smoker » 08 Feb 2015, 12:30

Domino wrote:what do you mean give an example of what you want to happen.

The "self" as far as I know of has to be based off of a Unit entity. The slider itself can alter the position of any other form of entity type but it's owner must be a Unit. Was wondering if there was a way to have the owner set as the projectile or any other generic entity type?
Resin_Smoker
Evaluator
 
Posts: 858
Joined: 14 Mar 2012, 17:58
Has liked: 54 times
Been liked: 106 times

Re: Sliders

Postby Domino » 08 Feb 2015, 12:41

Hey,

Sliders can be based off anything you just need the entity in which you want to manipulate, getting a projectile entity id in the user layer is no easy task, however LOL with DMS
i added code to store all projectile entity ids in a table when a unit creates one it also removes them when they die, you can get all (living) projectiles or filter a single a one.

i added that code because i was going to add a mini stats ui that would say how many shots fired / units killed / hit rate / dmg dealt but also so we manipulate a projectile at any time.

Dave
Domino
Priest
 
Posts: 315
Joined: 14 Mar 2012, 21:07
Has liked: 3 times
Been liked: 75 times

Re: Sliders

Postby Domino » 08 Feb 2015, 12:44

the problem with sliders is because they are in the userlayer, you have to do a sim callback to effect the entity, this is obviously every game tick as sim callbacks operate every tick.. this is why its easy to use them on static objects.
Domino
Priest
 
Posts: 315
Joined: 14 Mar 2012, 21:07
Has liked: 3 times
Been liked: 75 times

Re: Sliders

Postby Resin_Smoker » 08 Feb 2015, 14:03

Domino wrote:the problem with sliders is because they are in the userlayer, you have to do a sim callback to effect the entity, this is obviously every game tick as sim callbacks operate every tick.. this is why its easy to use them on static objects.

I'm guessing that as only units have callbacks it why sliders will not function with other entity types?
Resin_Smoker
Evaluator
 
Posts: 858
Joined: 14 Mar 2012, 17:58
Has liked: 54 times
Been liked: 106 times

Re: Sliders

Postby Resin_Smoker » 08 Feb 2015, 14:06

Domino wrote:Hey,

Sliders can be based off anything you just need the entity in which you want to manipulate, getting a projectile entity id in the user layer is no easy task, however LOL with DMS
i added code to store all projectile entity ids in a table when a unit creates one it also removes them when they die, you can get all (living) projectiles or filter a single a one.

i added that code because i was going to add a mini stats ui that would say how many shots fired / units killed / hit rate / dmg dealt but also so we manipulate a projectile at any time.

Dave

So how can can I make this work?
Resin_Smoker
Evaluator
 
Posts: 858
Joined: 14 Mar 2012, 17:58
Has liked: 54 times
Been liked: 106 times

Re: Sliders

Postby Domino » 08 Feb 2015, 14:17

They can work with any entity, you just need the entity id, you will need to get the projectile id on create and pass that to the userlayer or store it on the unit, you will 100% have to pass the unitid to the userlayer so then when you do the callback you can grab this unit then when you
adjust the slider send the callback and grab the projectile from the given entityid and do what you want to do with it.. from simcallbacks.lua

look at how i did the shield slider in DMS and 4dc.. same principal but different outcome pal.

Dave
Domino
Priest
 
Posts: 315
Joined: 14 Mar 2012, 21:07
Has liked: 3 times
Been liked: 75 times

Re: Sliders

Postby Domino » 08 Feb 2015, 14:19

also we cannot get projectiles in the sim by get enititybyid it doesnt work, you have to actually store the projectile somewhere on the unit in the sim and have the unit retrieve the actual object.
Domino
Priest
 
Posts: 315
Joined: 14 Mar 2012, 21:07
Has liked: 3 times
Been liked: 75 times

Re: Sliders

Postby Resin_Smoker » 08 Feb 2015, 15:34

Domino wrote:also we cannot get projectiles in the sim by get enititybyid it doesnt work, you have to actually store the projectile somewhere on the unit in the sim and have the unit retrieve the actual object.



So during the entities OnCreate then?

Wouldn't this be part or the entities "self" ?
Also would we use GetEntityById or just the Id directly with the slider function?

Resin
Resin_Smoker
Evaluator
 
Posts: 858
Joined: 14 Mar 2012, 17:58
Has liked: 54 times
Been liked: 106 times


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest