Tasharen Entertainment Forum

Support => Other Packages => Topic started by: BuddyBoy on April 14, 2014, 09:57:50 AM

Title: Tasharen Fog of War change axis to 2D x-y
Post by: BuddyBoy on April 14, 2014, 09:57:50 AM
Sorry for the duplicate post, I have been search for answers for 2 days and I see this question popping up on a few forums so I thought it would be a good idea to post a
new thread so we can all see the answer here.


I am working on a 2D game in Unity 4.3 and I want to use this but the x/y axis is not supported.

Please can you explain each file to modify and what to change to use the 4.3 2D x-y. I saw somebody else asked this but I was a little lost.

I assume the cs files as well as the shader, but please outline the changes.

Thanks.

Buddy
Title: Re: Tasharen Fog of War change axis to 2D x-y
Post by: BuddyBoy on April 15, 2014, 12:49:34 AM
Hi Aren. Please help, been three days now with no answers. I have purchased all of your plugins/ games - some I don't even use but I wanted to show my support of your business - I have also never pestered you for support and figured it out myself.

If you could advise on the above, it would be most appreciated.
Title: Re: Tasharen Fog of War change axis to 2D x-y
Post by: BuddyBoy on April 15, 2014, 05:03:39 AM
I need the FOG to use the image effect - to XY setup.


Title: Re: Tasharen Fog of War change axis to 2D x-y
Post by: ArenMook on April 15, 2014, 10:42:45 AM
Alright, well first look at FOWImageEffect. It also uses XZ there (line 80). You will want to change this to XY.

In the FOW.shader you will want to change .xz to .xy on line 52.

If you already made all the changes to FOWSystem then I think this should be it.
Title: Re: Tasharen Fog of War change axis to 2D x-y
Post by: BuddyBoy on April 15, 2014, 12:04:59 PM
Done! Thanks :)
FOWImageEffect was the key,thanks !
Title: Re: Tasharen Fog of War change axis to 2D x-y
Post by: hurleybird on June 21, 2014, 06:51:27 PM
In the FOW.shader you will want to change .xz to .xy on line 52.

I'm also trying to get fog of war to work for an XY 2D game. These instructions don't seem valid any longer. In the current version line 52 reads as "pos.xyz = pos.xyz * 2.0 - 1.0;" and changing to .xy doesn't work. 
Title: Re: Tasharen Fog of War change axis to 2D x-y
Post by: ArenMook on June 22, 2014, 09:16:13 PM
Line 84, hurleybird:
  1. float2 uv = pos.xz * _Params.z + _Params.xy;
Note the ".xz". If you search the shader for ".xz" you will only find this one reference.
Title: Re: Tasharen Fog of War change axis to 2D x-y
Post by: fkufgs on November 26, 2014, 09:57:15 PM
Hi,

been trying to achieve this myself for a while but to no avail.

Could you share these scripts please n thank you.  :P

Thnx

Cheers,
Title: Re: Tasharen Fog of War change axis to 2D x-y
Post by: fkufgs on November 28, 2014, 02:28:18 PM
Any one have this done and would like to share scripts??? Aren???

Thnx,

Cheers
Title: Re: Tasharen Fog of War change axis to 2D x-y
Post by: ArenMook on November 30, 2014, 06:05:45 AM
I've never done it myself. I merely guided others to how to do it. I don't have a script to share.
Title: Re: Tasharen Fog of War change axis to 2D x-y
Post by: fkufgs on November 30, 2014, 11:10:47 AM
Hi Aren, do you mind telling me what functions to change in the system.cs script, i did the shader and other script.

thnx,

Cheers
Title: Re: Tasharen Fog of War change axis to 2D x-y
Post by: ArenMook on December 02, 2014, 12:44:35 PM
Basically search for ".z" and replace it with ".y".
Title: Re: Tasharen Fog of War change axis to 2D x-y
Post by: JayExbl on July 28, 2015, 05:32:38 AM
I tried several times to get this working but I'm afraid I've had no luck.

I changed float y = t.position.z - mFog.worldSize * 0.5f;
to float y = t.position.y - mFog.worldSize * 0.5f;

Also changed .z's to .y's in FOWsystem.

At this stage it still doesn't work for me, so I also changed this:

mSize = new Vector3(worldSize, heightRange.y - heightRange.x, worldSize);
to:
mSize = new Vector3(worldSize, worldSize, heightRange.y - heightRange.x);

Still not working.

Not sure if there's anything else I need to do in regards to co-ordinates in my scene, but I think its all based on world co-ords?

If I can get the fog to reveal, generally what I'll see is a big line getting revealed on the Y axis, which should be a radius.

If anyone's got this working in the latest version I'd love to hear from you (or the developer!).
Thanks,
Jay