UOGamers Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • To obtain new Razor updates, please reinstall Razor from our new website.

[SVN514][Copern] Missing Necromancy Potions

Status
Not open for further replies.

Xavier

Account Terminated
Re: [READY] Missing Necromancy Potions

conflag/confusion pots.

timers are wrong. Confuse should have a 1 second delay after throwing it (targetting) and the conflag should have 1.5 sec delay.

When targetting yourself, your version of the pots immediately detonate the pots when the player targets himself. One OSI .. the delay is the same as if one targetted 5 tiles away on the ground.

The animation for confusion is slightly wrong. Confusion creates a square of particles as you have it, but picture your square being [ ] ... the left hand side [ shows first, then about .25 of a second later the right half ] shows, about the same time as the first half is disappearing. And, actually the square isnt really a square: the corners are rounded off, semi-circular. If you need a screenshot or AVI of it to look at, let me know.
 
Re: [READY] Missing Necromancy Potions

SRC Xavier;587869 said:
conflag/confusion pots.

timers are wrong. Confuse should have a 1 second delay after throwing it (targetting) and the conflag should have 1.5 sec delay.

When targetting yourself, your version of the pots immediately detonate the pots when the player targets himself. One OSI .. the delay is the same as if one targetted 5 tiles away on the ground.

The animation for confusion is slightly wrong. Confusion creates a square of particles as you have it, but picture your square being [ ] ... the left hand side [ shows first, then about .25 of a second later the right half ] shows, about the same time as the first half is disappearing. And, actually the square isnt really a square: the corners are rounded off, semi-circular. If you need a screenshot or AVI of it to look at, let me know.

Got it. Still not ready then. I don't think I can correct all of this in few minutes, and I don't think I can correct this at all.

I believe the patch in this thread is outdated, so I am posting a new one. -> Done. Look at first post of this thread.
 
Re: [IN DEVELOPMENT] Missing Necromancy Potions

Put it to coder needed, please. I have tried but I can't figure how to fix it :-/
 

uome

Bug Hunter
Re: [READY] Missing Necromancy Potions

SRC Xavier;587869 said:
conflag/confusion pots.

timers are wrong. Confuse should have a 1 second delay after throwing it (targetting) and the conflag should have 1.5 sec delay.

When targetting yourself, your version of the pots immediately detonate the pots when the player targets himself. One OSI .. the delay is the same as if one targetted 5 tiles away on the ground.
I think i have fixed this bit :)

SRC Xavier;587869 said:
The animation for confusion is slightly wrong. Confusion creates a square of particles as you have it, but picture your square being [ ] ... the left hand side [ shows first, then about .25 of a second later the right half ] shows, about the same time as the first half is disappearing. And, actually the square isnt really a square: the corners are rounded off, semi-circular. If you need a screenshot or AVI of it to look at, let me know.
This looks far too complicated for me to do :(

Anyway heres a new patch with the fix for the timers.
 

Attachments

  • necro pots.patch
    26.5 KB · Views: 9
Re: [READY] Missing Necromancy Potions

SRC Xavier;587869 said:
The animation for confusion is slightly wrong. Confusion creates a square of particles as you have it, but picture your square being [ ] ... the left hand side [ shows first, then about .25 of a second later the right half ] shows, about the same time as the first half is disappearing. And, actually the square isnt really a square: the corners are rounded off, semi-circular. If you need a screenshot or AVI of it to look at, let me know.

About the square with corners rounded off:

I have tried but looks like it's already so in the patch. Infact, the code about effect (see below) is trying, if I have understood well, to build a circled area.

Let's go for the timers:

In BaseConfusionBlastPotion.cs there are these 2 babies:
Code:
        #region Effects
        public static void EffectCircle( Point3D center, Map map, int radius )
        {
            Point3D current = new Point3D( center.X + radius, center.Y, center.Z );
[COLOR=Red]
            for ( int i = 0; i <= 360; i ++ )
            {
                Point3D next = new Point3D( (int) Math.Round( Math.Cos( i ) * radius ) + center.X, (int) Math.Round( Math.Sin( i ) * radius ) + center.Y, current.Z );

                EffectLine( current, next, map );

                current = next;
            }
        }
[/COLOR]
        public static void EffectLine( Point3D start, Point3D end, Map map )
        {
            if( start.Equals( end ) )
                return;

            int difX = Math.Abs( start.X - end.X );
            int difY = Math.Abs( start.Y - end.Y );

            int x = start.X;
            int y = start.Y; 

            int avgX = (int) Math.Round( difY != 0 ? difX / (double) difY : 0 );
            int avgY = (int) Math.Round( difX != 0 ? difY / (double) difX : 0 );

            while ( x != end.X && y != end.Y )
            {
                Point3D p = new Point3D( x, y, start.Z );

                if ( map.CanFit( p, 12, true, false ) )
                    Effects.SendLocationEffect( p, map, 0x376A, 4, 9 );

                if ( avgX <= 0 )
                {
                    if ( x < end.X )
                        x += 1;
                    else if ( x > end.X )
                        x -= 1;    
                    avgX = (int) Math.Round( difY != 0 ? difX / (double) difY : 0 );
                }                

                if ( avgY <= 0 )
                {
                    if ( y < end.Y )
                        y += 1;
                    else if ( y > end.Y )
                        y -= 1;

                    avgY = (int) Math.Round( difX != 0 ? difY / (double) difX : 0 );
                }

                avgX -= 1;
                avgY -= 1;
            }
        }
        #endregion
I have marked in red where I think there is the matter:

if he's trying to do a circle doing an animation for each angle (from 0 to 360), a solution would be:

for (0 to 180) { blah blah };
pause 0.25 sec
for (180 to 360) { blah blah same as before };


now, who helps me to translate it in C#? :)

edit: of course, angles need to be checked: I don't know in which direction that code is meaning for the 0 angle. In maths usually is the right side... so those number would make appear the lower part first, the upper part before. Well... solutions are 0,90,180 and 270 so it's not a big deal.
 
Re: [READY] Missing Necromancy Potions

osd_daedalus;596649 said:
if he's trying to do a circle doing an animation for each angle (from 0 to 360), a solution would be: {SNIP}

Please ignore what I have said: I have tried to substitute that 360 with 180 but I have always that same circle (or square? With normal confusion blast seems rounded).
 
Re: [READY] Missing Necromancy Potions

SRC Xavier;587869 said:
The animation for confusion is slightly wrong. Confusion creates a square of particles as you have it, but picture your square being [ ] ... the left hand side [ shows first, then about .25 of a second later the right half ] shows, about the same time as the first half is disappearing. And, actually the square isnt really a square: the corners are rounded off, semi-circular. If you need a screenshot or AVI of it to look at, let me know.

If you could post an AVI would be great :)
 

Xavier

Account Terminated
Re: [CODER NEEDED] Missing Necromancy Potions

Here you go! Its high-res and high framerate so you can see it well. It extracts a LOT larger than the RAR, more like 44mb.

rar rocks :D
 

Attachments

  • confusion.rar
    315.3 KB · Views: 14
Re: [CODER NEEDED] Missing Necromancy Potions

awesome, thank you! Hmmm... looks like the entire animation is wrong then, also about the "thickness" (seems 3 tiles from border in the video).
 
Re: [CODER NEEDED] Missing Necromancy Potions

Since I don't get in any way how to handle that part about the effect...

[22:15] <uome> i had another look at them necro pots today
[22:15] <uome> i still cant get it :(
[22:15] <Daedalus> heh, me too
[22:15] <Daedalus> the entire effect thing should be rewritten
[22:16] <uome> what we have atm seems to be a circle of sorts
[22:16] <Daedalus> because as it is now, it's trying to make a circle (even if borders are not really cut down)
[22:16] <Daedalus> maybe it would be necessary to do 2 half-circles
[22:17] <uome> the half bits confuse me
[22:17] <Daedalus> yep me too
[22:17] <uome> is that an osi bug
[22:17] <uome> lol
[22:17] <Daedalus> hehe :)
[22:17] <Daedalus> effectively... a blast should always spread on circle ;)
[22:17] <uome> making it appear all at once is a but better?
[22:18] <Daedalus> hmmm... let's see what they say
So, what you say? :)

edit: pathetic attempts to sustain a theory:

(the triangle was going well... the forum formatting screwed even worse than in IRC!)
[22:25] <Daedalus> that method "EffectLine"
[22:25] <Daedalus> says what happen in one line
[22:25] <Daedalus> and it's repeated 360 times by the method "EffectCircle" just above
[22:25] <uome> ah yes maybe
[22:25] <Daedalus> public static void EffectCircle( Point3D center, Map map, int radius )
[22:25] <Daedalus> {
[22:25] <Daedalus> Point3D current = new Point3D( center.X + radius, center.Y, center.Z );
[22:25] <Daedalus> for ( int i = 0; i <= 360; i ++ )
[22:25] <Daedalus> {
[22:25] <Daedalus> Point3D next = new Point3D( (int) Math.Round( Math.Cos( i ) * radius ) + center.X, (int) Math.Round( Math.Sin( i ) * radius ) + center.Y, current.Z );
[22:25] <Daedalus> EffectLine( current, next, map );
[22:25] <Daedalus> current = next;
[22:25] <Daedalus> }
[22:25] <Daedalus> }
[22:26] <Daedalus> every time it's called EffectLine with a new "i" value
[22:26] <Daedalus> "i" becomes 0,1,2...360
[22:26] <Daedalus> but I already tried to substitute 180 to 360... I don't have an halved circle :/
[22:27] <uome> i changed a few numkbers earlier too and nothing changed either
[22:27] <Daedalus> hmmm
[22:27] <Daedalus> if I remember something about trigonometry
[22:28] <Daedalus> every line "radius" is meant to be the longest side of a rectangle triangle
[22:28] <Daedalus> that's why it gets the X with Cos and the Y with Sin
[22:29] <Daedalus> go for ascii art!
[22:29] | Unknown command
[22:29] <Daedalus> no, can't do the pipe as a line in IRC :/
[22:30] I Unknown command
[22:30] <Daedalus> ah, it's the slash
[22:30] <uome> hmm been a long time since i was at school
[22:30] <Daedalus> me too
[22:30] <Daedalus> I love maths, even if I always sucked in it :)
[22:30] <Daedalus> |\
[22:30] <Daedalus> hmmm
[22:30] <Daedalus> no spaces...
[22:31] <Daedalus> .........|\
[22:31] <Daedalus> .........| \
[22:31] <Daedalus> .........| \
[22:31] <Daedalus> .........| \
[22:31] <Daedalus> .........| \ radius
[22:32] <Daedalus> .sin (i) * radius..| \
[22:32] <Daedalus> argh
[22:32] <Daedalus> well, the other is cos (i) * radius
[22:32] <Daedalus> and (i) in this case is 90°
[22:32] <Daedalus> I suck in ASCII art :/
[22:32] <uome> that makes sense
[22:33] <uome> so its chucking out little triangles atm Oo
[22:34] <uome> thats why the corners look odd when it gets larger too
[22:36] <Daedalus> yes
[22:38] <Daedalus> (maybe)
 

Xavier

Account Terminated
Re: [CODER NEEDED] Missing Necromancy Potions

haha! I wasn't trying to be cruel here .. but it does look drastically different. If you can work out the geometry, just draw two half circles, putting the second one on a delayed timer.
 
Re: [CODER NEEDED] Missing Necromancy Potions

SRC Xavier;604931 said:
haha! I wasn't trying to be cruel here .. but it does look drastically different. If you can work out the geometry, just draw two half circles, putting the second one on a delayed timer.

Already tried :(
I already tried to lower the reiterations from 360 to 180 and I expected a half circle... instead I got the same circle...

I was thinking, instead, maybe the circle method is wrong... it does 360 reiterations, 1 per angle... but you don't have 360 tiles on the circumference. Being a Math.Round, sometimes could explain why borders are not always curved.

Maybe I'll try to work it by rectangles... I mean: 4 rectangles would give you this:
View attachment 16180

In grey I filled parts that should be considered for the visual effect, while the entire area would be considered for the potion effect.

Let's see if it's possible to do something like that, before to surrender...

P.S. That guy got scoliosis!
 

Attachments

  • Immagine.JPG
    Immagine.JPG
    9.1 KB · Views: 99

Xavier

Account Terminated
Re: [CODER NEEDED] Missing Necromancy Potions

osd_daedalus;605109 said:
Already tried :(
I already tried to lower the reiterations from 360 to 180 and I expected a half circle... instead I got the same circle...

Perhaps the problem is in the fact that there arent 360 usable degrees in a UO circle that small - because its basically pixelized. A circle has an infinite number of positions possible, but a UO circle is very finite, with a resolution much larger than a single degree.

If I had to guess I would say its somewhere between 60 and 90 tiles around the circumferance.
 
Re: [CODER NEEDED] Missing Necromancy Potions

Being ML mods on the way, these potions should also support the Balanced mod.

Oh, I think I have told this somewhere in this thread but, due to the invite to quote origins...

This script is stol... *ahem* based on MalGanis' * (so I suppose MalGanis + Callandor2k) and edited for OSI accuracy by Nikki, emooo, gilgamash and me.

* but I'm almost sure MalGanis' original script is based on Arthanys work: http://www.runuo.com/forums/custom-script-releases/83264-2-0-rc1-potions.html
 

uome

Bug Hunter
Re: [CODER NEEDED] Missing Necromancy Potions

This is so close to being finished, does someone want to pick it up and tweak it?
Please :)
 
Re: [CODER NEEDED] Missing Necromancy Potions

uome;672824 said:
This is so close to being finished, does someone want to pick it up and tweak it?
Please :)

This patch misses:

1) Potions to be influenced by Balanced bow mod
2) Confusion Blast / Greater Confusion Blast potions range and visual effect to be as OSI.
 
Re: [CODER NEEDED] Missing Necromancy Potions

You know why the circle effect that is now is uncontrollable?

Why if I set 90 reiterations instead of 360 I still have a full circle?

This is what if I set 10 (see screenshot).

That circle won't work properly. Translating: this code is shit! :mad:

I think I need a course about area graphical effects... maybe I can reach to resolve this one...
 

Attachments

  • Daedalus_12-30_18.50-8.jpg
    Daedalus_12-30_18.50-8.jpg
    201.2 KB · Views: 49
Re: [CODER NEEDED] Missing Necromancy Potions

silvertiger;680418 said:
Do we not have some code you can steal from?

it's THAT code that is shit :p

Seriously, with all respect of the original author (MalGanis, Arthanys or someone else), I think the idea of drawing a circle by using trigonometrical functions was theorically correct, but not suitable for something with few tiles like the UO map. Plus, there is something wrong.

Anyway, I played a bit with Linux plotting tools and I decided to search for a non-trigonometrical function.

Now, IIRC, the circle Cartesian function is x^2 + y^2 = 1, where 1 is the radius.
So, y = sqrt (radius^2 - x^2)

I have thought to get a circle, instead I got an half circle. Better, since y = - sqrt (radius^2 - x^2) will give me the other half... and I need 2 half circles.
Here's a result:
View attachment 21500

Now, making it suitable for UO map, I tried Floor, but it makes my Y as a Y-1. That's normal, since with Floor function, a Y = 7.999999 will return 7.
View attachment 21501

Ceiling, instead, will leave a white space in the X. Ceiling-1 = floor.

View attachment 21502

this program won't allow Round, but it's what I want to try.

I think we are really close to what we want to get. If it works, later I will see how to add a "thickness".

My 2 cents about math ;) (hey, I haven't seen a math book from 6 years!)
 

Attachments

  • func.jpg
    func.jpg
    42.2 KB · Views: 36
  • func2.jpg
    func2.jpg
    39.6 KB · Views: 37
  • func3.jpg
    func3.jpg
    39.5 KB · Views: 34

psz

Administrator
Re: [CODER NEEDED] Missing Necromancy Potions

Why not use the spawner's Homerange?

It's a circle, it's settable in script or [props...
 
Status
Not open for further replies.
Top