• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Need help: limitations of GUI & JASS damage displayer

Status
Not open for further replies.
Level 2
Joined
Jun 12, 2007
Messages
21
hello guys,

i've been a long time visitor of hiveworkshop.com although i never actively participated in these forums myself. I'm a big fan of orpg maps and i have been toying around with the editor for a long time, but recently i have begun a more serious attempt to make an rpg map of myself.

however i've ran into a big problem: i am a total novice at JASS, and i ran into a trigger that i want to make, that cannot be done with just GUI. Since JASS seems to be a reaaaaally complex codelanguage (for a novice like me anyway) and since i already mastered GUI, i am not really eager to start learning JASS.

Is there any way i can enhance the GUI options of the trigger editor by means of an unofficial patch or mod or something of the sorts? that would be the perfect solution to me.



also, could an experienced JASS codewriter translate this into JASS(or something like this)? its not possible to make this in GUI alone (in my version of the editor anyway):

events:
a unit takes damage

conditions:

Actions:
Create floating text that reads (string((damage taken))) above (unit taking damage) with Z offset 100.00 using fontsize 10.00, color (100%(red),0%,0%) and 0.00% transparancy

change hight of (last created floating text) to 250 over 5 seconds

Change the lifespan of (last created floating text) to 5 seconds

Change the fading age of (last created floating text) to 3 seconds



any help would be greatly apprieciated
 
Level 2
Joined
Jun 12, 2007
Messages
21
ah I catch your drift maker, I can see how that would work. But my map will hold hundreds of units, which will all need to be entered into a variable, and have their own event. wouldnt a variable array with a size of several hundred and hundreds of events cause a ton of lag?
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
You do not need to hold them in any array (and no it won't lag at all). The bad point at this is that it leaks events - when a unit dies, the event stays.
That's why I told you to look for an on-damage system, damage-detection system, or whatever they are called.
They solve it by destroying the trigger and recreating it from time to time (the less times the better, since destroying triggers can cause bugs).
 
Level 2
Joined
Jun 12, 2007
Messages
21
Ghostwolf, could you explain how to do this without a variable unit array? i thought Maker ment something like this (see below), but i could be wrong... i dont see how to do this without a really long variable, since my map will hold a ton of enemy units.


Trigger one: unit creation trigger

event: not important
condition: not important
Action: create unit.................
set variable (unit array #....) to last created unit


Trigger two: floating text creator

events: (unit array #1) takes damage
(unit array #2) takes damage
(unit array #3) takes damage
etc...
conditions:
etc...
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I do not have warcraft and I hardly remember GUI's syntax, but it's something around this:

  • AddEnter
    • Events
      • Unit - A unit enters the map
    • Conditions
      • // might want to leave unimportant units out
    • Actions
      • Add event ((Triggering Unit) takes damage) to OnDamage
  • AddBegin
    • Events
      • Game - On Map Initialization
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Pick every unit in (every unit you want) and do Actions
        • Add event ((Picked Unit) takes damage) to OnDamage
  • OnDamage
    • Events
    • Conditions
    • Actions
      • // whatever actions you want
But like I said, this leaks an event every time a unit that was checked dies. You can still use it as these leaks are small, but if you're expecting huge numbers of units to die (like an ORPG for example), you'd better go with better systems which are mostly coded in Jass (in case you do not know Jass, this doesn't mean you can't use them in GUI with 1-2 custom scripts).
 
Level 2
Joined
Jun 12, 2007
Messages
21
@ ghostwolf: when you create an event: Triggering unit takes damage, then i'm pretty sure wc3 won't recognise any unit, so that would'nt work without a variable would it?

@ Purple Root: i can't make heads or tails out of that intuitive damage detection system :p
 
Status
Not open for further replies.
Top