Doom Angel's Question Thread

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
u mean something like this:
Code:
Every Sec
    Events
        Time - Every 0.50 seconds of game time
    Conditions
    Actions
        Floating Text - Change the position of <<Floating Variable>> to <<My Unit>> with Z offset 0.00
 

Cilla

is watching you! Ahh, fresh meat!
Reaction score
39
Y exact, I use this 2 for an equal problem.
But maybe you should take a point with a polar offset.
 

Tom Jones

N/A
Reaction score
437
Indeed, with these triggers be very sure that you don't create memory leaks. If I mess up with a timer, I've to shut down wc3 after 30 seconds, even though my computer has over 1 gb memory, and dual core processor.
 

Cilla

is watching you! Ahh, fresh meat!
Reaction score
39
but if i move it on unit it wouldn't make memory leaks would it?

As far as I know it would.
Store this Point in a variable and remove the location afterwads.
You know what I am sure.

Edit: I just read its leak free?
 

Tom Jones

N/A
Reaction score
437
Yea, if you create the texttag on a unit it won't leak. This is the Create Text Tag On Unit action:
Code:
function SetTextTagPosUnitBJ takes texttag tt, unit whichUnit, real zOffset returns nothing
    call SetTextTagPosUnit(tt, whichUnit, zOffset)
endfunction
It points to SetTextTagPosUnit which looks like this:
Code:
native SetTextTagPosUnit takes texttag t, unit whichUnit, real heightOffset returns nothing
No location, no leak.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
nvm i anyway needed to use point so i guess i will just remove the leaks but im having new problem since that im having all that with array so it would be MUI but with Every sec event i can't get in the array sommthing like Triggering player is there any event for a unit moves?
 

Tom Jones

N/A
Reaction score
437
Try this:
event > conditions > actions
A generic unit is issued a point order and A generic unit is issued a target order > order = "move" or order = "smart" or order = "attackmove" or order = "attack" > start timer
A generic unit is issued no point order > order = "stop" or order = "hold" > stop timer
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
i didn't realy understand it but it won't be much of help call if some1 order it to move it will move it once and the unit will still walk without the text
 

Tom Jones

N/A
Reaction score
437
Let me elaborate:
When a unit is issued a point or unit target order start the timer, and when a unit is issued stop or hold you should stop the timer.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
nvm i think i solved it out using integer A here's both of the triggers:
Code:
Player Speaks
    Events
        Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
        Player - Player 2 (Blue) types a chat message containing <Empty String> as A substring
        Player - Player 3 (Teal) types a chat message containing <Empty String> as A substring
        Player - Player 4 (Purple) types a chat message containing <Empty String> as A substring
        Player - Player 5 (Yellow) types a chat message containing <Empty String> as A substring
        Player - Player 6 (Orange) types a chat message containing <Empty String> as A substring
        Player - Player 7 (Green) types a chat message containing <Empty String> as A substring
        Player - Player 8 (Pink) types a chat message containing <Empty String> as A substring
        Player - Player 9 (Gray) types a chat message containing <Empty String> as A substring
        Player - Player 10 (Light Blue) types a chat message containing <Empty String> as A substring
    Conditions
    Actions
        Floating Text - Destroy FloatingChat[(Player number of (Triggering player))]
        Set Loc[(Player number of (Triggering player))] = (Position of SaveLoadPlayerHeroSingle[(Player number of (Triggering player))])
        Set Loc_2[(Player number of (Triggering player))] = (Loc[(Player number of (Triggering player))] offset by (-130.00, 0.00))
        Floating Text - Create floating text that reads ((|cffff0000 + (PlayerName[(Player number of (Triggering player))] + : |r)) + (Entered chat string)) at Loc_2[(Player number of (Triggering player))] with Z offset 150.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        Set FloatingChat[(Player number of (Triggering player))] = (Last created floating text)
        Floating Text - Show FloatingChat[(Player number of (Triggering player))] for (All players)
        Floating Text - Change FloatingChat[(Player number of (Triggering player))]: Disable permanence
        Floating Text - Change the lifespan of FloatingChat[(Player number of (Triggering player))] to 10.00 seconds
        Trigger - Turn on Move With Hero <gen>
        Custom script:   call RemoveLocation(udg_Loc [GetConvertedPlayerId(GetTriggerPlayer())])
        Custom script:   call RemoveLocation(udg_Loc_2 [GetConvertedPlayerId(GetTriggerPlayer())])
Code:
Move With Hero
    Events
        Time - Every 0.03 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 10, do (Actions)
            Loop - Actions
                Set Loc[(Integer A)] = (Position of SaveLoadPlayerHeroSingle[1])
                Set Loc_2[(Integer A)] = (Loc[1] offset by (-130.00, 0.00))
                Floating Text - Change the position of FloatingChat[(Integer A)] to Loc_2[(Integer A)] with Z offset 150.00
                Custom script:   call RemoveLocation(udg_Loc [GetForLoopIndexA()])
                Custom script:   call RemoveLocation(udg_Loc_2 [GetForLoopIndexA()])
will it be MUI?
 

Tom Jones

N/A
Reaction score
437
Nope, but it's multi player instanceable, meaning that all players can have 1 unit who uses the trigger at once.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
u mean MPI?
if yes than it's k im anyway having only 1 hero for each (it's an RPG)
thanks for ur help +Rep :D
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
sry for bumping but i got another question just for the interest:

would it matter if i have 1 in the array or 100?
 

Cilla

is watching you! Ahh, fresh meat!
Reaction score
39
I think so, there will be saved some place for the usage of the variable.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
i mean if i use 1 instead of 100 how much numbers is that like limit the number of arrays or something mabye?
how would i know when to put 1 array or 50 or 100?
 

Cilla

is watching you! Ahh, fresh meat!
Reaction score
39
You know what an array is?

I don quite get your question.

An array is a List of variables each having the same datatype.
With the [ ] you get acces to the specific variable in this list.

Arrays start with [0]

for example

IntegerArray[0] = 100
IntegerArray[1] = 213
etc whatever
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
i know that but my question is what's the difference beetwen if i put 1 or 100 in the array?
i don't think blizzard just put so we will have some hard time choosing a number, it must have some purpose....
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
Well, the array number can be acquired using a formula, so if you wanted to store something in an array, but didn't know what number it would be, that might be useful... (For example, you want the data to correspond to the player, so you enter (player number) for the array number.)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top