Maybe.. just maybe you are trying to create the dialog while the map is initializing. Waiting 0.01 second or so before creating the dialog might solve your problem.
that is correct. The variable in your function is also a copy, not of the group but of the group handle.
If you assign the handle of g1 to g2 for example they will both point to the same memory.
What you have to do is create a second group (g2 = CreateGroup()) and add every unit from g1 to...
that is because a group is actually a handle to a place in memory. If you pass the handle to another function it can change the memory using the handle.
An integer for example is a type that is usually 4 bytes in size, just as big as a handle. Unlike groups, the integer is copied to the...
I'm sorry but I don't understand what you are saying.
In the CountGroup function I posted I use a global bj variable to count because the forgroup function can't take a function with arguments.
I can't do this for instance
function CountIncr takes integer i returns integer
return i +...
I created a map to test your code and it compiled perfectly :)
When I cast the spell it only counts the units once, I'm not sure if that is your problem but it is caused by your CountGroup function
I have rewritten it so that it doesn't remove units from the group because I guess you need...
library Group
globals
group GROUP = CreateGroup()
endglobals
endlibrary
library ConeFilter initializer init requires Group
struct ConeSector
real x
real y
real radiusSquared
real facing
real halfangle
real x1
real y1
real x2
real y2...
It probably doesn't display anything because there is something wrong with your CountGroup function.
Can you post the complete code that fires the functions and the functions themselves you have now?
Look at this
local group g = CreateGroup()
//and this
set g = whichGroup
It's not your problem :P but it doesn't make sense to create a group, then assign the group handle to another group.
You should read the Leakless groups tutorial from jesus4life and rewrite your function. It...
I'm not sure but I think heroes always keep their handles, unless you remove them from te game. Units will disappear from the game after some time, they won't be reviveable I think so their handles will point to something unexpected after a while :)
Hahah, if you download the map there is an example trigger: fictional example
It tries to do what you said, I discovered that having textmacro's run other textmacro's wasn't possible at this time.
I solved it by making a base unit that has most stats set correctly, and then base other units...
Well, I personally hate searching for values, waiting untill I've got a copy of a unit and doing the same stuff over and over again.
So if I wan't to create a map which has about 500 upgradeable buildings, I'd want to use something like this. For small amounts of buildings that aren't similar...
Should I write that someone who wants to use this should copy this
//! externalblock extension=lua ObjectMerger $FILENAME$
///! runtextmacro MakeBuilding("BASE_ID", "NEW_ID")
//! runtextmacro MakeBuilding("hhou", "hH01")
///! runtextmacro MakeChangeArt("BTNX", "BTNY", "GROUND_TEX"...
Hi there, it's me again.
This time I'm on the forums because I'd like to save you some time. The next snippet allows you to create buildings very easily and rapidly. It requires:
Newgen
which should come with ObjectMerger.
//---HEADER---
// This file was made by Prozix.
// It...
You are a genius xD
exitwhen true
would do the trick.
But if you don't want to quit immediately but you do want to know if the condition was true at least once, you should use a boolean right?
btw, I remember that a long time ago I've been searching for a break statement xD
Yeah ofcourse, but the original condition was i>=bj_MAX_PLAYERS.
You could do this
exitwhen i>=MAX_PLAYERS or SomeCondition
when SomeCondition is a boolean. If it's a big function used to do something in the loop it would be pretty useless to call it again in the exitwhen statement because it...
You might want to move the units in the filter itself (you'll have to write it yourself) so you don't loop over the filtered units twice. Also
//this loop format makes more sense in my opinion
local integer i = 0
loop
// goes from 0 to bj_MAX_PLAYERS-1
if...