PDA

View Full Version : Special Trigggers


gamer102
07-31-2006, 11:22 PM
Did you hear about a trigger "Name Spoofer" (Polar Escape 3)
Did you hear about a trigger "Unit Colorizer" (Myself)
Did you hear about a trigger "Item Abilities" (HeroCraft/Hero Creation Maps)

Name Spoofer

Names
Events
Player - Player 1 (Red) types a chat message containing -name as A substring
Player - Player 2 (Blue) types a chat message containing -name as A substring
Player - Player 3 (Teal) types a chat message containing -name as A substring
Player - Player 4 (Purple) types a chat message containing -name as A substring
Player - Player 5 (Yellow) types a chat message containing -name as A substring
Player - Player 6 (Orange) types a chat message containing -name as A substring
Player - Player 7 (Green) types a chat message containing -name as A substring
Player - Player 8 (Pink) types a chat message containing -name as A substring
Player - Player 9 (Gray) types a chat message containing -name as A substring
Player - Player 10 (Light Blue) types a chat message containing -name as A substring
Player - Player 11 (Dark Green) types a chat message containing -name as A substring
Player - Player 12 (Brown) types a chat message containing -name as A substring
Conditions
Actions
Player - Set name of (Triggering player) to (Substring((Entered chat string), 6, (Length of (Entered chat string))))


Unit Colorizer

Colors
Events
Player - Player 1 (Red) types a chat message containing -color as A substring
Player - Player 2 (Blue) types a chat message containing -color as A substring
Player - Player 3 (Teal) types a chat message containing -color as A substring
Player - Player 4 (Purple) types a chat message containing -color as A substring
Player - Player 5 (Yellow) types a chat message containing -color as A substring
Player - Player 6 (Orange) types a chat message containing -color as A substring
Player - Player 7 (Green) types a chat message containing -color as A substring
Player - Player 8 (Pink) types a chat message containing -color as A substring
Player - Player 9 (Gray) types a chat message containing -color as A substring
Player - Player 10 (Light Blue) types a chat message containing -color as A substring
Player - Player 11 (Dark Green) types a chat message containing -color as A substring
Player - Player 12 (Brown) types a chat message containing -color as A substring
Conditions
Actions
Animation - Change (Random unit from (Units currently selected by (Triggering player)))'s vertex coloring to ((Real((Substring((Entered chat string), 8, 10))))%, (Real((Substring((Entered chat string), 12, 14))))%, (Real((Substring((Entered chat string), 16, 18))))%) with 0.00% transparency


Item Abilites

Abilities
Events
Unit - A unit Uses an item
Conditions
Actions
-------- Avatar --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to Item Avatar
(Level of Avatar for (Hero manipulating item)) Equal to 0
Then - Actions
Unit - Add Avatar to (Hero manipulating item)
Else - Actions
Unit - Increase level of Avatar for (Hero manipulating item)

Now make an item, and a If Then Else actions for each item ability you have (and a ability "level up" that does nothing (for just using the item))
I created the "Unit Colorizer"
If you see a map that was created with my trigger then I did not create it becuase I did not know there was already someone who did that

It's all done with substrings

Now you post all the Special Triggers you know (If you want to) in [code]

refl3ction
08-04-2006, 3:37 PM
sweet, these could be helpful, but only if there was a way to change the name of an actual unit

gamer102
08-04-2006, 6:35 PM
Ya that would be even sweeter

hooded
08-04-2006, 8:22 PM
lol, try entering a name like |cffff0000A|r|n|n|cff00ff00 ^^ says A|r

and if you want to rename a unit, you can always replace it ;)

gamer102
08-04-2006, 8:51 PM
and if you want to rename a unit, you can always replace it ;)
Replace and rename units, how

hooded
08-04-2006, 11:36 PM
create a unit with the name you desire, then use the unit - replace triggers. This will allow the name to be changed, but not to a great many variations. You could always create floating text over the guy, but thats sort of messy.

Theres probably some jass function to actually change the name of the unit.

create a unit with the name you desire, then use the unit - replace triggers. This will allow the name to be changed, but not to a great many variations. You could always create floating text over the guy, but thats sort of messy.

Theres probably some jass function to actually change the name of the unit. Ask someone like sid who is more fluent than I.

gamer102
08-05-2006, 3:26 PM
Ya plus i wnna know how to create driving controls with jass (AzerothGrandPrix). I can't tell what the jass it doing so i can't make my own but thanks

Zipsco
08-05-2006, 6:58 PM
Most things can be done without jass, though it might be more clean and better running with jass, just like the region leak lag problems experienced with the GUI triggering, which i had a hard time seing because of my computer :D had to like spawn 2000 units at once before i experienced anything noticable. Anyway back to the problem. Now what i know about the data classes used in wc3 is that most of the values you talk about is pretty FIXED, and is not allowed to be changed. Just look at the dumbass me trying to change prices on items through triggering, that too is not really possible. And the conclusion me and sid ran into was that you needed to hack wc3, with an mpq tool.

Now as an example, i wanted to change the price of an item in a shop OR just the actual templated item, this was not possible for some reason. Haven't even found jass functions that can do it, and they can only do it if allowed by blizzard, haven't really seen that anywhere. Item and unit(many other objects) custimization of class instances are pretty much untouchable. Have to change the restrictions in the actual code for that.

remember that data is treated the same way nomatter what data it is, as long as it shares some sort of data type(not meaning int or class name, but just simply class anything), meaning that ofc if you change the restrictions you are allowed more, but most "programmers" and/or teams have rules as to how these things should be "classified" and "restricted" thats why we see so many similarities between the possibilities of items and units, both pretty grabable objects.

gamer102
08-06-2006, 2:42 PM
Well put Zipsco (I've never heard of GUI trigggering)

I tried creating driving controls without jass, I got the whole picture in my head of how to do it (Create a region, set that region ahead of the unit by about 300, tell that unit to move to that region, do it agiain) But, I can't seem to do it.

refl3ction
08-07-2006, 4:25 PM
Well put Zipsco (I've never heard of GUI trigggering)

GUI triggering is the basics of the trigger editor, it uses the format
Event -
Conditons -
Actions -

its pretty much the beeting heart of most custom game, except when they have advanced triggerers that use jass for spells,systems and etcetra

(my favorite trigger below)
Event -
A Unit Dies
Conditions -
Actions -
Kill (Dying Unit)

:D

Zipsco
08-07-2006, 5:07 PM
You can do exsactly the same in jass scotty, but the thing is many people think its more supportive, but really stuff like functions are giving to you through "trigger - run trigger", and the arguments should be delivered through variables. And as specified before the thing about using jass isn't more options, its that you get to specifie more detailed exsactly how you want the game to do what you want. Now a fine example is like the functions i spoke of earliere.

Now to give a function arguments in GUI you need to make global variables, because there are no such thing as local variables in GUI, only stuff thats local are event responses, like "dying unit" - "triggering player" and stuff like that, but they are used constantly so it won't help much... Anyway Using functions in jass will allow you to actually specifie a flow of control over the variables, so only 40 % of the variables are used at the time. These are the great features, but are also very hard to control for the inexperienced user, it gives no worries like memory leaks, since i do not use jass much i do not know which precautions they got for such no-no-stuff :D

gamer102
08-07-2006, 5:43 PM
Yeah, well i'll post some jass of the (8)AzerothGrandPrix but I don't get, All i see is "return"


Acceleration
Events
Player - Player 1 (Red) Presses the Up Arrow key
Player - Player 2 (Blue) Presses the Up Arrow key
Player - Player 3 (Teal) Presses the Up Arrow key
Player - Player 4 (Purple) Presses the Up Arrow key
Player - Player 5 (Yellow) Presses the Up Arrow key
Player - Player 6 (Orange) Presses the Up Arrow key
Player - Player 7 (Green) Presses the Up Arrow key
Player - Player 8 (Pink) Presses the Up Arrow key
Conditions
GameOver Equal to False
Actions
Custom script: call Accelerate( GetTriggerPlayer(), udg_ACCELERATE_FORWARD )



function Accelerate takes player plPlayer, integer nAccelerating returns nothing
local integer nPlayerIndex = GetPlayerIndex(plPlayer)
if ( nPlayerIndex < 0 ) then
return
endif
if ( udg_Accelerating[nPlayerIndex] != udg_ACCELERATE_COAST ) then
return
endif
set udg_Accelerating[nPlayerIndex] = nAccelerating
endfunction


What does this simply mean (The second part "udg.....")

Custom script: call Accelerate( GetTriggerPlayer(), udg_ACCELERATE_FORWARD )


Is ther some kind of online manual for jass?

refl3ction
08-07-2006, 7:04 PM
though im not excactley sure what it meeans but its apart of every custom script, by that i mean its needed to call the variable, point, rec, funtion or whatever your calling

gamer102
08-08-2006, 1:28 AM
Plus! You know those Jass triggered item inventory (Holds 6+ Items)

Thats easy to do if you think about it for a while (You don't even need any jass)

1. Store the items currently in all the slots (Integer and Item Variables for each slot)
2. Remove all items from currently showing slots (New page of items)
3. If item (next page is used), then load items from storage and give them to hero

Zipsco
08-08-2006, 11:25 AM
Hehe, not quite as easy gamer102, you are forgetting that some people want the items in the inventory not shown to give their buffs/abilities, thats easiere said than done, believe me!

Anyway explanation to:

Custom script: call Accelerate( GetTriggerPlayer(), udg_ACCELERATE_FORWARD )

explanation ->

Easy, using the call in jass i most likely calling a function, meaning a lump of code that does something specific, like changing a players name, whatever. Now this specific function here is called "Accelerate" and uses, what i refered to before(before post), arguments, which are actually local (or global, but wouldn't make sence), variables, which is tranfered to the function. Teh edit --> BUT --> in this case "GetTriggerPlayer()" is used, now when supplying functions inside an argument it means, run the function and return whatevers in the return to the argument field of the other function. Thats where return comes in, it simply returns a value from a function, and its most simple use is -> VARIABLE = FUNCTION, then: "Return value --(Into)---> Variable"!!



Now i surgest reading about programming, and i surgest reading like a tutorial on c++ which will give you a general knowlegde of scripting/programming theories, though the syntax(how similar stuff is written) is different between langauges, like in c++ you would never write "Call" you would simply write the name of the functions nothing more. But you will get the hang of it. Now the idea about local variables are that they are non-existent when you are not INSIDE the function, or popular term, you are not executing it or within its scope. This means that if all you stuff is local variables, you will only have the memory allocated(reserved) that is needed, if you have 5 functions in your map, all uses 5 kb of memory(that being ONLY the variables, and only true in this example, maybe you will use 10kb or whatever), You will per "default" only use 5 kb of memory at all time (for more experienced programmers: ofc, different using multiple threads at the time, but not for the beginners here, so shut up, per default aswell) If you make the same in triggers and allocate variables using 5 kb per trigger, they would be global variables (unless using the create local variable, which is a jass feature if you use custom script or converts a trigger to jass) this means that no matter where or what you are doing they will always be there (the variables), therefore you will be using 5 x 5 kb of memory thats 5 times more! strange enough :D So that are some of the advantages of JASS, but remember this is only a small look on some reasons to use, its no tutorial! I still surgest reading a tutorial on cpp which will give you all the basic theory and syntax(of cpp) but most syntaxes are like very much!

GRR another

gamer102
08-08-2006, 1:17 PM
(Jass)
Ya I kinda forgot about getting the abilities held
================================================== =========
(Programming)
I have Visual C# Express Edition
================================================== =========
(Call)
I get what you're saying about "calling a function"
================================================== =========
(C)(C+)(C++)(C#)
Which one is the closest to "Jass Scripting"?
Do I need to learn more about C++ Programming?
================================================== =========
If you just had
call Accelerate()
what would that do

I found This site
http://jass.sourceforge.net/doc/