HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Weird angle problem, and pair attachment issue

06-14-2008, 08:32 AM#1
the-thingy
I'm having 2 really annoying problems with a spell I'm making.

The spell is supposed to make a nova of lightning bolts appear at regular intervals, but the bolts are moving at incorrect angles (looks triangular, when it should be square/diamond-shaped)

Here's a screenshot to show you just how messed up it is
Hidden information:


Here's the whole code:
Expand Full code:

And here's the code associated with proj spawning and movement (to narrow the search for the problem down :P)
Expand Proj spawn and movement:

My second problem... I'm trying to prevent units being affected multiple times by different projectiles using HAIL's pair attachment, but units who are affected once can't be hit by the spell anymore. I'm fairly sure I cleared the pair data correctly. I've tried using groups (the units don't seem to be in the group, and I've tried 3 different types to attach to the unit (boolean, string and integer) and none of them seem to work :(

Here's the code associated with projectile hit
Expand Proj hit:

And I don't really want posts about "this could be better" and such, I know that the code isn't great at the moment. I just want to fix the spell, then I can clean it up and improve it.
06-14-2008, 09:10 AM#2
Fireeye
The problem is as much as i get it that you're using degree instead of Rad.
There are 2 solutions for this problem.
1. Setting the variable ANGLEINC to 2*bj_PI/PROJCOUNT
2. Using a BJ_DEGTORAD in the MoveTimerCallback
06-14-2008, 09:18 AM#3
the-thingy
... that was a stupid mistake, thanks :D Now the projectile movement works perfectly, just need to fix the collision problem
06-17-2008, 10:46 PM#4
the-thingy
Bump

Anyone have any idea why the attachment doesn't get cleared?
06-18-2008, 02:20 AM#5
grim001
Quote:
Originally Posted by Strilanc
I think pair properties currently have a bug which makes ResetAny*For break when you have more than 1 pair property. I'll get around to fixing it but am currently kindof busy.

From the HAIL thread, pair properties are currently bugged.

Out of curiosity are you using HAIL just for pair properties? It is very easy and probably equally as fast to use GC for pair data.
06-18-2008, 02:25 AM#6
Here-b-Trollz
Furthermore, I can't think of a reason why this spell needs attaching... just store everything in a stack and loop through it.

Uses only one Timer, Requires no outside Code, and Probably Faster.
06-18-2008, 04:32 AM#7
Strilanc
Quote:
Originally Posted by grim001
From the HAIL thread, pair properties are currently bugged.

Out of curiosity are you using HAIL just for pair properties? It is very easy and probably equally as fast to use GC for pair data.

It should still work if you're only using one pair property, though.

Turn on debug mode and see if it prints out created/destroyed at the correct times.
06-18-2008, 10:56 AM#8
the-thingy
Quote:
Originally Posted by grim001
From the HAIL thread, pair properties are currently bugged.

Out of curiosity are you using HAIL just for pair properties? It is very easy and probably equally as fast to use GC for pair data.

I'm using it for single attachment (if that's what you'd call it) as well i.e. struct to timer, struct to trigger. At first I thought it was a pair attachment issue so I tried to put the affected units into a group and attach a boolean only to the affected unit, then reset it in a ForGroup, but that didn't work either.

Quote:
Turn on debug mode and see if it prints out created/destroyed at the correct times.

How exactly would I go about doing that? I'm not familiar with alot of that NewGen stuff (I assume it's a NewGen feature?)

Quote:
Furthermore, I can't think of a reason why this spell needs attaching... just store everything in a stack and loop through it.

Uses only one Timer, Requires no outside Code, and Probably Faster.

I've heard that so many times, and here's the reason why:
I don't know how to do it (correctly).
06-18-2008, 11:06 AM#9
Anitarf
Quote:
Originally Posted by the-thingy
I've heard that so many times, and here's the reason why:
I don't know how to do it (correctly).
Hmm, check out the example in this post:
http://www.wc3campaigns.net/showpost...5&postcount=11
06-18-2008, 11:37 AM#10
the-thingy
Ah, I see :) Thanks for the info. I'll see what I can do.

My only problem is how to check if a unit is already affected by that instance? Should I use a group within the struct? Or is there any other way that wouldn't cause MUI problems (I can see global arrays causing MUI problems :\)
06-18-2008, 12:15 PM#11
grim001
Using a group within the struct would be the easiest and fastest way to do it.
06-18-2008, 12:26 PM#12
the-thingy
Let's hope units are added to the group this time around
06-18-2008, 12:49 PM#13
Here-b-Trollz
Make sure you are creating the group with CreateGroup() before you add units to it with GroupAddUnit().
06-18-2008, 01:19 PM#14
the-thingy
Quote:
Originally Posted by Here-b-Trollz
Make sure you are creating the group with CreateGroup() before you add units to it with GroupAddUnit().

If I didn't do that, I would've got unitialized variable error anyway (which I didn't when I tried groups), right?
06-18-2008, 01:54 PM#15
Here-b-Trollz
If you are using grimore with wc3err on, then yes you would have.