• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Blademaster + Defend and String

Status
Not open for further replies.
Level 4
Joined
Mar 16, 2008
Messages
46
So I has a footman with blademaster model, how to make the unit go whirlwind animation when defend is activated while attacked?

What I need is when an arrow hit the unit, it will go spinning and the arrow deflect away.


My map also has alot of string event, which goes like this:

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Level of Game - MS 01 for Map Setting 0025 <gen>) Equal to 1
    • Then - Actions
      • Set Temp_String01 = 1
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Game - MS for Map Setting 0025 <gen>) Equal to 2
        • Then - Actions
          • Set Temp_String01 = 2
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Game - MS for Map Setting 0025 <gen>) Equal to 3
            • Then - Actions
              • Set Temp_String01 = 3
            • Else - Actions
  • Game - Display to (All players) for 3 seconds the text: Temp_String01
Some times Temp_String01 will be show in the game in floating text form or as frequent as 0.03 seconds in game message.

I need to know if these kind of string event cause lag in a 1-3 hour game. Thanks
 
For your animation --> you need to temporally change it's animation type to "stand spin" (not sure about the name; open model editor to see the exact animation name) and change it back to defend after the spell.

I saw in a jass tutorial that stings do leak and that you can't do anything about it. I recommend setting a special variable array aside and give it it's values during map init.
you can then just use:
"Display to (All players) for 3 seconds the text: Temp_String01[Level of Game - MS for Map Setting 0025 <gen>]" instead of I/T/E (if then else), but that's only if your trigger will run more than once
 
Level 4
Joined
Mar 16, 2008
Messages
46
I need the blademaster spin when the effect of defend initial, the moment an arrow hit it, not when defend is activated. It wouldn't make sense if the blademaster spin when defend is activated, and doing nothing when the arrow hit him and get deflected.

As for the string, I know presetting string variables help, but what if in that sentence include non-fix element like showing how much current gold for the triggering player? does that mean i have to set a string variable for 1 to 1,000,000?
 
It wouldn't make sense if the blademaster spin when defend is activated
but
make the unit go whirlwind animation when defend is activated while attacked
Its confusing :vw_wtf: I thought you asked him to spin while in defend mode.

I think you want to know how to detect when a missle hit the bladebaster right?
If so, you'll need a Damage engin


For your sting - it won't have any lag effect when the trigger run around 10 times per minute for 3 hours, but if you have a 'for every 0.01 second of game time' for a looping spell which creates strings then you would have a problem. Consider this: make a trigger that creates a location every 0.01 secs of game time. It would take around 10 minuts for it to start lagging when you have 6000X10 leaks. Therefore I don't think that your computer can't handle 6X180 leaks assuming your trigger runs 10 times per minute for 3 hours :)
 
Level 4
Joined
Mar 16, 2008
Messages
46
Okay, sorry for the confusion, I try to make it easier to understand.

1. A blademaster with the default Defend ability.
2. When it activated, no changes of animation.
3. While the ability in active mode, the blademaster is attack by a archer.
4. The arrow hit the blademaster
5. The blademaster go spinning for about a second.
6. The arrow deflected.
7. The blademaster return back to normal animation.

I hope I don't need extra triggering, I just want the Defend ability make the blademaster do spinning when it do it's trick.


As for the string, is there any tutorial that talk about this, it really hard to grab it.

For instant,
1. An announcement made every 1 second with the same sentence.
2. An announcement made every 1 second with only 1 word different.

Does both case cause same amount of leak?

The problem is I need to use game message very often, like every few second detect gold income and announce it to respective player, or tell player they require this much of customize resources, or their units lack certain type of upkeep.
 
Level 4
Joined
Mar 16, 2008
Messages
46
Many thanks for the trigger, but my map already have many triggers, not sure if I going to implement it or I might take other alternative for the skills, still thanks for the trigger.

Also your suggestion of multiboard for replacement is very good, some of the function can use this method, However there are still things I need to use game message to tell the players frequently.

If i use pre-set variables for the announcement, can I avoid this string leak issues?

  • Set String_Resources[1] = |cffFF0000Not enought gold.|r
  • Set TempPlayerGroup01 = (Player group((Player(TempInt01))))
  • Game - Display to TempPlayerGroup01 the text: String_Resources[1]
  • Custom script: call DestroyForce (udg_TempPlayerGroup01)
There are also custom resources I used in game and when worker return those resources to the base, I use floating text to imitate warcraft3 default return resource ability.

  • Set TempInt01 = (Random integer number between 90 and 110)
  • Floating Text - Create floating text that reads (|cff00FF00 + ((String(TempInt01)) + |r)) at TempPoint01 with Z offset 40.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
  • Floating Text - Change (Last created floating text): Disable permanence
  • Floating Text - Change the lifespan of (Last created floating text) to 7.00 seconds
  • Floating Text - Change the fading age of (Last created floating text) to 6.00 seconds
There is a String inside floating text, would this cause string leak too?

Thank you.
 
Luckily the limit for code is high so it doesn't matter how many triggers you put into it. You should implement it this way because it has the most control and there is no other skill/ability that actually does what you wanted. Your welcome. =)

Game messages are a bad way to do things because it clogs up the chat area and blocks player chat as well player chat blocks it. String leaks aren't really an issue, there is a max for texttags you know and it is 100. After you have made 100 floating text's none will appear after the others are removed.

The reason why string leaks should be ignored and aren't an issue is well because they're like unit leaks.... You can't do a single thing about them. You can however preload them because every unique string that is created will only be made once and will only leak once.

Generates a string that depending on damage ranges might be highly unique.

Each unique string leaks, there is no way to remove strings from WC3 memory however if the same string is generated again it will not make a new string (it recycles existing strings).

With enough string leaks it is possible for the game to perform so badly that any string creation will cause many frames to be dropped.

Want more information?

http://www.hiveworkshop.com/forums/2594699-post6.html
http://www.hiveworkshop.com/forums/triggers-scripts-269/lag-buildup-overtime-256811/ - Post #13 and below has information you seek in this link.
 
Level 4
Joined
Mar 16, 2008
Messages
46
Game messages are a bad way to do things because it clogs up the chat area and blocks player chat as well player chat blocks it.

Ya, I notice that, but game message wouldn't push player chat upward, right? So I put alot of spaces before the message like this.

  • Set String_Resources[1] = ........................................|cffFF0000Not enought gold.|r
This way the game message appear in the lower middle of the screen. (The dot is empty space, weird it auto cut away if I use space)


String leaks aren't really an issue, there is a max for texttags you know and it is 100.

Unknowingly, I copy and paste something very long, and the editor crash, but still enough for the message I use which is usually short.


After you have made 100 floating text's none will appear after the others are removed.

Is this truth? so after the 100th floating text, no more floating text appear? I use to encounter a strange situation, it is a alter melee map I made, I put floating text above certain places as name, but out of 9 such floating text, only 5 or so appear.

The map is here :
HTML:
http://www.hiveworkshop.com/forums/maps-564/war-map-v1-2-a-155313/

But anyway, do you think people actually care whether the amount of custom resources return show up or not?


The reason why string leaks should be ignored and aren't an issue is well because they're like unit leaks.... You can't do a single thing about them. You can however preload them because every unique string that is created will only be made once and will only leak once.

So, it is alright for me to preset every single game message I need in game?
 
Level 6
Joined
Jan 4, 2014
Messages
227
By the way,Deffend ability is one of those spells that cannot be leveled up ( having three levels for exemple ).
 
Status
Not open for further replies.
Top