HugoLafisques
Junior Member
Posts: 4
Threads: 1
Joined: Oct 2013
Reputation:
0
|
Attaching lights to entities
Hi there,
I've been messing around in the amnesia model editor for a little while and managed to attach some lights and billboards to the grunt model; but I'm running into a problem when the grunt despawns - the lights and billboards aren't deactivated as well, leaving me with some floating lights at wherever in the map the enemy was.
Any ideas?
|
|
10-23-2013, 03:14 PM |
|
Acies
Posting Freak
Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation:
73
|
RE: Attaching lights to entities
Manually deactivate the lights. Not sure there is 'an easy way' to do this.
Bind the billboards of the grunt to a light (all in the modeleditor). I know that setting the color of the pointlight 'black' hides the billboards;
void FadeLightTo(string& asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);
The name of the pointlight would be "servant_grunt_1_pointlight_1" - I hope you understand the naming convention.
I'm not sure if;
void SetLightVisible(string& asLightName, bool abVisible);
Works as well.
It appears as if this can be set up to work 'automatically', by using the callbackfunc specified in the 'entity' tab of the leveleditor of the grunt/brute;
OnAutoDisabled (hover mouse on the white blank).
Best of luck - I'm not huge on scripting so someone else will have to step in, in case this general overview doesn't do it. :]
ジ
(This post was last modified: 10-23-2013, 09:03 PM by Acies.)
|
|
10-23-2013, 09:01 PM |
|
HugoLafisques
Junior Member
Posts: 4
Threads: 1
Joined: Oct 2013
Reputation:
0
|
RE: Attaching lights to entities
wow, that's a pain in the ass
thanks for the help, i'll give it a go
|
|
10-24-2013, 02:04 AM |
|
HugoLafisques
Junior Member
Posts: 4
Threads: 1
Joined: Oct 2013
Reputation:
0
|
RE: Attaching lights to entities
For some reason i'm getting the error 'OnAutoDisable' is not a valid data type?
I'm probably doing this completely wrong, but here's my function:
void enemylight(string &in EntityName, OnAutoDisabled)
{
FadeLightTo("servant_grunt_light", 0, 0, 0, 0, 0, 0.1);
}
Edit:
Also in the model editor would the light be named pointlight_1, then outside of that it would be referred to as "servant_grunt_1_pointlight_1" ?
(This post was last modified: 10-24-2013, 04:57 PM by HugoLafisques.)
|
|
10-24-2013, 04:53 PM |
|
Acies
Posting Freak
Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation:
73
|
RE: Attaching lights to entities
In response to your edit - yes. So, the light needs to be renamed in the script you provided.
Also, I dug through old scripts to find the correct format - tried to 'translate' into something for you:
void enemylight(string &in EntityName, string &in Type)
{
if(Type == "OnAutoDisabled")
{
FadeLightTo("servant_grunt_1_light_1", 0, 0, 0, 0, 0, 0.1);
}
}
(Keep in mind that the editors like to add an underscore and a number on names!).
The script assumes that you named your pointlight = 'light'
ジ
(This post was last modified: 10-24-2013, 06:42 PM by Acies.)
|
|
10-24-2013, 06:41 PM |
|
HugoLafisques
Junior Member
Posts: 4
Threads: 1
Joined: Oct 2013
Reputation:
0
|
RE: Attaching lights to entities
Awesome man, it works! thanks a lot for the help, I searched for ages on documentation for this kind of stuff but couldn't find anything
|
|
10-25-2013, 02:38 AM |
|
Acies
Posting Freak
Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation:
73
|
RE: Attaching lights to entities
Awesome!
ジ
|
|
10-25-2013, 09:07 PM |
|
|