how to superload playerFOV - adding telepathy similar talent

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
MisiuPysiu
Archmage
Posts: 379
Joined: Tue Nov 11, 2003 10:54 am
Location: Wroclaw/Poland

how to superload playerFOV - adding telepathy similar talent

#1 Post by MisiuPysiu »

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:)

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: how to superload playerFOV - adding telepathy similar ta

#2 Post by HousePet »

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.

MisiuPysiu
Archmage
Posts: 379
Joined: Tue Nov 11, 2003 10:54 am
Location: Wroclaw/Poland

Re: how to superload playerFOV - adding telepathy similar ta

#3 Post by MisiuPysiu »

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:)

MisiuPysiu
Archmage
Posts: 379
Joined: Tue Nov 11, 2003 10:54 am
Location: Wroclaw/Poland

Re: how to superload playerFOV - adding telepathy similar ta

#4 Post by MisiuPysiu »

The same problem can be found in the Necromancer plus addon.
It seems, no one found a clean way of doing the telepathy thing...

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: how to superload playerFOV - adding telepathy similar ta

#5 Post by HousePet »

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.
My feedback meter decays into coding. Give me feedback and I make mods.

Nagyhal
Wyrmic
Posts: 282
Joined: Tue Feb 15, 2011 12:01 am

Re: how to superload playerFOV - adding telepathy similar ta

#6 Post by Nagyhal »

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.

Marson
Uruivellas
Posts: 645
Joined: Thu Jan 16, 2014 4:56 am

Re: how to superload playerFOV - adding telepathy similar ta

#7 Post by Marson »

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.

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: how to superload playerFOV - adding telepathy similar ta

#8 Post by HousePet »

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.
That might work. Remind me to try it.
My feedback meter decays into coding. Give me feedback and I make mods.

Post Reply