• 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.

[JASS] Let's see what JASS can do

Status
Not open for further replies.
Level 9
Joined
May 30, 2008
Messages
430
First let's begin with the fact that i don't know JASS, but i need a JASS trigger that do somthing that i don't think you guys still try to do.
So i need JASS script that is creating new trigger in game and in this trigger have to be added 1 condition and few actions. So let's say that you have damage detection system but after the unit count reach 2000 you decide to destroy this trigger and to create new one and to begin unit counting from 1.
Example: i have already created 3 triggers (in the world editor) for damage detections (DamageDetection1, DamageDetection2, DamageDetection3) (triggered by adding the entering unit in playable map area to the event). When the unit count in the DamageDetection1 reach 500 DamageDetection2 is activated and then wait 15 minutes and destroy the DamageDetection1. I need when DamageDetection1 is destroyed new one to be created with 1 condition and few actions. I need only creating the trigger and add actions and condition to it in game and some one to tell me if is posible how to trigger it so it can create this trigger. Note that i must be able to destroy this trigger later in game again so this script have to be able to repeat creating the triggers. +Rep to the good ones (i dunno who JASS but rep will be added w/e :wink:)

If somthing is not clear ask me i will clear it for you. Don't tell me that destroying a trigger may crash the game, couse a desynch or somthing else this won't happen in my map belive me i know what i am trying to do :cute:
 
Level 4
Joined
Mar 23, 2008
Messages
87
Please explain the algorithm behind what you're trying to do.
It would be highly inefficient to create new triggers and even if you did you have to have the functions the trigger links to allready made.

So please elaborate on this damage detection scheme of yours
 
Level 9
Joined
May 30, 2008
Messages
430
Just use script "call DestroyTrigger(TrigeringTrigger())" or what was that script called...

Use I/T/E for it.

Also can't you just reset and disable trigger? And when time comes re-enable?

There is no option in warcraft to "reset" a trigger this is not tamagochi

@Bomi
This is the things that have to be added to the new trigger
  • Trigger1
    • Events
    • Conditions
      • ((Triggering unit) has buff Devour) Equal to False
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to unitOld[(Integer A)]
            • Then - Actions
              • Unit - Replace (Triggering unit) with a unitNew[(Integer A)] using The new unit's max life and mana
            • Else - Actions
  • Trigger2
    • Events
    • Conditions
      • ((Triggering unit) has buff Devour) Equal to False
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to unitOld[(Integer A)]
            • Then - Actions
              • Unit - Replace (Triggering unit) with a unitNew[(Integer A)] using The new unit's max life and mana
            • Else - Actions
When i destroy those triggers i wonna create new ones the same as those

And i am adding the units like this
  • Trigger - Add to Trigger1 <gen> the event (Unit - MyUnit[MyUnitCount]'s mana becomes Less than 0.10)
 
Level 3
Joined
Dec 6, 2005
Messages
67
maybe i'm looking at this the wrong way, but those look the same... can't u just 'turn on' , 'turn off' the trigger and reset the variables?
 
Level 4
Joined
Mar 23, 2008
Messages
87
@onix_noob, I have trouble seeing what the trigger is supposed to do. elaborate please?

I don't think you have to make loads of triggers and destroying them again. It would be easier to explain what you have to do if I know what you want to achieve.
 
Level 9
Joined
May 30, 2008
Messages
430
@Drenith
YOU CAN'T RESET EVENTS or TRIGGERS THIS IS NOT TAMAGOCHI (THIS IS SPARTA)

@Storyyeller
Good you know how triggers of type damage detection work this is good

@Bomi
I am trying to find a way to make new trigger ingame with 1 condition and 4 actions and to be able to refer in late game to destroy this trigger and create it again when i decide
 
Level 9
Joined
May 30, 2008
Messages
430
JASS:
call TriggerAddCondition(someTrigger,Filter(function someFunc))

call TriggerAddAction(someTrigger,function someFunc)

That's what you do to initialize triggers... why are you surprised you can do it later on?

I found those ones in the JASS craft but becouse of the fact that i can't fill the gaps i am refering to this forum. If i know how to fill them i won't make new thread and i even't won't ask about things that i already know.
I don't need whole trigger i need just to give me a hand for example show me simple how to make 1 new trigger with 1 action, 1 condition and one event or give me tutorial. I know wwhere the JASS commands are my problem is i don't know what they do and i don't know how to fill them. If i know this i will do the stuff myself :ned: thanks for your attention
 
Level 2
Joined
Jul 17, 2009
Messages
27
JASS:
<variabletype> trigger <variablename> = CreateTrigger()
call TriggerAddCondition(<variablename>, Condition(<conditionfunc>))
call TriggerAddAction(<variablename>, function <actionfunc1>))
call TriggerAddAction(<variablename>, function <actionfunc2>))
call TriggerAddAction(<variablename>, function <actionfunc3>))
call TriggerAddAction(<variablename>, function <actionfunc4>))

If you need to refer back to the trigger, use a global variable to store the handle. Otherwise, a local variable will do.


Sadly, this is all irrelevant, because you should not use dynamic triggers due to WC3 bugs.
 
Level 4
Joined
Mar 23, 2008
Messages
87
@Bomi
I am trying to find a way to make new trigger ingame with 1 condition and 4 actions and to be able to refer in late game to destroy this trigger and create it again when i decide

Why?
This makes absolutly no sense and has no practical value.
You want to do it just because it is possible???
The trigger doesn't need to do anything as long as you can create it and destroy it?
 
Level 3
Joined
Dec 6, 2005
Messages
67
@onix_noob

frankly, i have no idea what TAMAGOCHI is and i don't know if most of the other posters do either. And the practical solution for the example you gave IS a trigger and variable reset, its the EXACT same thing that destroying the trigger and creating a new one would do. Perhaps if you gave some additional info on what exactly the 1 condition and 4 actions are that you are trying to implement we can see your problem, because as of right now you've got everyone confused.
 
Level 9
Joined
May 30, 2008
Messages
430
@onix_noob

frankly, i have no idea what TAMAGOCHI is and i don't know if most of the other posters do either. And the practical solution for the example you gave IS a trigger and variable reset, its the EXACT same thing that destroying the trigger and creating a new one would do. Perhaps if you gave some additional info on what exactly the 1 condition and 4 actions are that you are trying to implement we can see your problem, because as of right now you've got everyone confused.

DO you know what "Damage Detection system" is? Do you know how to make one in GUI? If yes here is my problem: Becouse of the fact that every time a unit is entering in the playable map area for this unit is created event and after 1+ hour playing in one trigger have like 1000+ events and the game is like "WTF so much to think about i just can't" and boom the game just crash or begin laging very badly or else. Becouse of the fact that i ask alot of ppl about "Can i destroy events or clear them" Every one say "NO". It appear once event is created it can't be destroyed so i decide to destroy the whole trigger and to create new one. But becouse of the fact that the best way of learning GUI is to watch how the others do it, to read which like do what and etc. The problem in JASS is that you don't know which like do what:confused:. So you can't learn by watching how others do it. Becouse of this fact JASS is not user friendly and most of the ppl know how to clean leaks nothing more. And ppl in this site think when they Copy the jass line from JASS craft they are "HELPING YOU" but actualy they are doing the same thing that u can do yourself. And becouse of the "helping" factor in this site i again have to drop this idea of my, becouse ppl JUST DECIDE TO COPY PASTE the things that i can find myself but don't know how to fill. The only one way of learning JASS for ppl that don't know C++ or other programing %^&*S i mean for normal gamers is by showing them how to do most of the things not by telling them this is scope like that and this is loop like that and we are like WTF

@Sophismata
What i have to write here? Do i have to do it like this
JASS:
call TriggerAddAction(<variablename>, function <function ReplaceUnitBJ takes unit whichUnit, integer newUnitId, integer unitStateMethod returns unit
    local unit    oldUnit = u
    local unit    newUnit
    local boolean wasHidden
    local integer index>))

IF YOU GUYS ARE NOT WILLING TO SHOW ME HOW TO DO IT JUST DON"T POST IN THIS THREAD BECOUSE FROM 10 POSTS HERE NO ONE IS ACTUALY HELPING ME (Let's don't speak that 4 of the posts aren't even related to the requested thing)
 
Level 14
Joined
Nov 18, 2007
Messages
816
Why dont you just convert a blank trigger to custom text and try to find a pattern?

Now for the ranting part:

Becouse of the fact that every time a unit is entering in the playable map area for this unit is created event and after 1+ hour playing in one trigger have like 1000+ events and the game is like "WTF so much to think about i just can't" and boom the game just crash or begin laging very badly or else.
Must be bad coding on your side, since i havent heard of similar systems having the same problems. Wait, youre using GUI...


The problem in JASS is that you don't know which like do what.
Try figuring it out. Hint: reading the whole damn line aloud can help.
So you can't learn by watching how others do it.
Bullshit. If thats the case, youre too dumb to understand it. Actually, reading other peoples code is one of the better ways to learn a programming/scripting language.
Becouse of this fact JASS is not user friendly and most of the ppl know how to clean leaks nothing more.
JASS is far more userfriendly, if you know it. Then we have little tools like JNGP that make it even easier to code.
And ppl in this site think when they Copy the jass line from JASS craft they are "HELPING YOU" but actualy they are doing the same thing that u can do yourself.
Actually, thats cosidered helping. Theyre getting you the glass of water on the other side of the table, so to speak.


And becouse of the "helping" factor in this site i again have to drop this idea of my, becouse ppl JUST DECIDE TO COPY PASTE the things that i can find myself but don't know how to fill.
ITS NOT OUR JOB TO DO YOUR WORK WHILE YOU SIT BACK. Go and help yourself. We can only point you the right way.


The only one way of learning JASS for ppl that don't know C++ or other programing %^&*S i mean for normal gamers is by showing them how to do most of the things
No. Did you learn anything when your teacher always did your math for you? I dont think so.
 
Level 4
Joined
Mar 23, 2008
Messages
87
The problem in JASS is that you don't know which line do what
The easiest way to learn the JASS Api for wc3 is to convert triggers you make in GUI and then try to figure out what does what. The names doesn't differ that much from GUI to JASS.
Syntax is usually the most difficult thing when moving to a new programing language, but once it's learned everything else is just memorizing.
Becouse of this fact JASS is not user friendly and most of the ppl know how to clean leaks nothing more.
Don't talk about things you know squat about.
JASS is easier and faster, but the learning curve is steeper.

The only one way of learning JASS for ppl that don't know C++ or other programing %^&*S i mean for normal gamers is by showing them how to do most of the things not by telling them this is scope like that and this is loop like that and we are like WTF
First of, programming is not %^&*S. It makes you smarter because it force you to think logical about a given problem.
scope and loop are part of the syntax, you should start with the syntax if you want to learn a programming languare.
Normal gamers also doesn't usually make maps for the games they play.
A loop is basicly the same as a For each integer A to <given number> in GUI.
Loops are more powerfull in JASS because you can set other conditions to when it stops. Eg. you can set exitwhen to a boolean, so it will loop untill the boolean returns true.

Stop whining and get cracking! Experiment and have fun. If it doesn't work the first time, try a few more times. If you get stuck return to the forums and get help.
Also, try to do some easy stuff before you do this damage detection system of yours. The fact is that you don't have enough knowledge to accomplish your goals, so instead of whining here you should expand your knowledge.
 
Status
Not open for further replies.
Top