Hi,
I wanted to superload the playerFOV function for a talent similar to the Preternatural Senses talent.
If I want to do it by the book i have to add my code at the end or the beginning of the function.
The beginning its not a good place because of the cleanFOV routine which would erase all my changes.
At the end, there is a different problem. Tiles I lite by means of telepathy or similar effects are only lit with a factor 0.6 (normal lit tiles have a factor of 1). the result is, all actors in my FOV are lit at a lite factor 0.6, even those I can see without telepathy.
I can make a workaround, by fully lighting all tiles i see by means of telepathy. This is not a "clean" way of doing this.
Do you guys (or girls... maybe) know a better way of doing this? I haven't included any code samples as I'm doing all the coding on a different computer but i hope you know what my problem is about.
Maybe a hook for adding FOV effects could be implemented?
Or just a better way of doing what i want to do (adding a telepathy talent).
Cheers:)
how to superload playerFOV - adding telepathy similar talent
Moderator: Moderator
-
- Archmage
- Posts: 379
- Joined: Tue Nov 11, 2003 10:54 am
- Location: Wroclaw/Poland
Re: how to superload playerFOV - adding telepathy similar ta
I did it in my Werebeast addon, but perhaps it has the same flaws you mentioned.
My feedback meter decays into coding. Give me feedback and I make mods.
-
- Archmage
- Posts: 379
- Joined: Tue Nov 11, 2003 10:54 am
- Location: Wroclaw/Poland
Re: how to superload playerFOV - adding telepathy similar ta
Yeah,
sadly it has the same flaws. I looked up your addon after noticing the telepathy problems with my code and you did it the same way (well, I did it the same well chronologically speaking).
Cheers:)
sadly it has the same flaws. I looked up your addon after noticing the telepathy problems with my code and you did it the same way (well, I did it the same well chronologically speaking).
Cheers:)
-
- Archmage
- Posts: 379
- Joined: Tue Nov 11, 2003 10:54 am
- Location: Wroclaw/Poland
Re: how to superload playerFOV - adding telepathy similar ta
The same problem can be found in the Necromancer plus addon.
It seems, no one found a clean way of doing the telepathy thing...
It seems, no one found a clean way of doing the telepathy thing...
Re: how to superload playerFOV - adding telepathy similar ta
I don't think I had noticed it before.
It might be possible to do a check of some sort to get it to skip grids you can already see.
It might be possible to do a check of some sort to get it to skip grids you can already see.
My feedback meter decays into coding. Give me feedback and I make mods.
Re: how to superload playerFOV - adding telepathy similar ta
Definitely support the notion of cleaner, more flexible vision functions.
I will have a look for solutions when I get Beholder gazes into the clean up phase.
I will have a look for solutions when I get Beholder gazes into the clean up phase.
Re: how to superload playerFOV - adding telepathy similar ta
I like the idea of hooks and superloading, but while working with the UI, I found that most of the time I had to overload the function. I needed to change the internal processing of the function, not just manipulate values before or after. It sounds like you have a similar case.
Right now I'm simply overloading each file I need changed. It may not play as nice with other addons as superloading would, but I try to load mine early to avoid issues. It sure makes it easier to update. When a new version of the module comes out, I can go through each overloaded file and do a file comparison to see what's been updated. If it's a small change, it's easier to just copy those snippets into my files, rather than move all my changes over to the new code. With superloading, I'd have to scrutinize each function piecemeal.
That said, as you go through each actor at the end, can you check to see what its current light value is? If it's 0, set it to 0.6. If it's 1, leave it alone.
Right now I'm simply overloading each file I need changed. It may not play as nice with other addons as superloading would, but I try to load mine early to avoid issues. It sure makes it easier to update. When a new version of the module comes out, I can go through each overloaded file and do a file comparison to see what's been updated. If it's a small change, it's easier to just copy those snippets into my files, rather than move all my changes over to the new code. With superloading, I'd have to scrutinize each function piecemeal.
That said, as you go through each actor at the end, can you check to see what its current light value is? If it's 0, set it to 0.6. If it's 1, leave it alone.
Re: how to superload playerFOV - adding telepathy similar ta
That might work. Remind me to try it.Marson wrote:That said, as you go through each actor at the end, can you check to see what its current light value is? If it's 0, set it to 0.6. If it's 1, leave it alone.
My feedback meter decays into coding. Give me feedback and I make mods.