Poll | | What game does everyone play now? | Starcraft 2 | | 26% | [ 8 ] | Warcraft 3 | | 35% | [ 11 ] | League of Legends | | 19% | [ 6 ] | World of Warcraft | | 0% | [ 0 ] | Diablo 2 | | 0% | [ 0 ] | No games at all | | 10% | [ 3 ] | Other game not listed | | 10% | [ 3 ] |
| Total Votes : 31 |
|
|
| How To Make A Wisp Wheel | |
|
+8Pat1487 Iord. marksoccer SEXorWAR-CRAFT bloodasb AmAzIn[G] Knight of Gods Achilles.42 12 posters | |
Author | Message |
---|
nomorholywar Sergeant
| Subject: Re: How To Make A Wisp Wheel Sat Dec 26, 2009 8:57 am | |
| 1. Make a unit array variable called Wisp. Then make an integer variable called Num. Create a real array variable called Angle. Then, make a region variable called Center. Finally, make a real variable called Distance. Make a trigger like this at map init that assigns your wisp units to the Wisp[#] variable, and then set the Num integer to the number of wisps you have spinning. Set the Angle[#] for each wisp to its starting angle position, set Center to the region they will revolve around, and Distance to the distance from that region (128 = 1 terrain space).: - Code:
-
Events Map initialization Conditions Actions Set Wisp[1] = Wisp 0001 <gen> Set Wisp[2] = Wisp 0002 <gen> Set Wisp[3] = Wisp 0003 <gen> Set Wisp[4] = Wisp 0004 <gen> Set Num = 4 Set Angle[1] = 0 Set Angle[2] = 90 Set Angle[3] = 180 Set Angle[4] = 270 Set Center = Region 001 <gen> Set Distance = 256 2. Next, make a trigger named Wheel, and convert it to custom text. Delete everything inside, and then paste the following code in it. - Code:
-
function Trig_Wheel_Actions takes nothing returns nothing
local integer i = 1
loop exitwhen i > udg_Num call SetUnitX(udg_Wisp[i], GetRectCenterX(udg_Center) + udg_Distance*CosBJ(udg_Angle[i])) call SetUnitY(udg_Wisp[i], GetRectCenterY(udg_Center) + udg_Distance*SinBJ(udg_Angle[i])) set udg_Angle[i] = udg_Angle[i] + 0.2 set i = i+1 endloop
endfunction
//=========================================================================== function InitTrig_Wheel takes nothing returns nothing set gg_trg_Wheel = CreateTrigger( ) call DisableTrigger( gg_trg_Wheel ) call TriggerRegisterTimerEventPeriodic( gg_trg_Wheel, 0.01 ) call TriggerAddAction( gg_trg_Wheel, function Trig_Wheel_Actions ) endfunction 3. That trigger starts turned off, so whenever you want to use that wisp wheel just turn Wheel on. If you have multiple wheels, then on the next level just reassign all those variables. Change the 0.2 in the line "set udg_Angle[i] = udg_Angle[i] + 0.2" to a higher/lower value to speed up/slow down the wheel. | |
| | | AmAzIn[G] Commander
| Subject: Re: How To Make A Wisp Wheel Sat Dec 26, 2009 12:57 pm | |
| Lol! this took me 3seconds to get working ty
*But How would i do this if i wanted the Center to be a unit?
i know id make a variable unit but the jass you wrote would have to be changed to what? | |
| | | nomorholywar Sergeant
| Subject: Re: How To Make A Wisp Wheel Sun Dec 27, 2009 12:38 am | |
| call SetUnitX(udg_Wisp[i], GetUnitX(udg_CenterUnit) + udg_Distance*CosBJ(udg_Angle[i])) call SetUnitY(udg_Wisp[i], GetUnitY(udg_CenterUnit) + udg_Distance*SinBJ(udg_Angle[i])) | |
| | | bloodasb Captain
| Subject: Re: How To Make A Wisp Wheel Sun Dec 27, 2009 11:19 pm | |
| Arun why dont u just make another topid "Better wisp wheel tut" or pat can move ur reply to another topic "[working] wisp wheel tut" OR ACH CAN FIX IT BECAUSE HES SUCH A LAZY ASS | |
| | | AmAzIn[G] Commander
| Subject: Re: How To Make A Wisp Wheel Mon Dec 28, 2009 3:19 pm | |
| now out of curosity can i make the centerUnit an array, like 1-12
as to make each demon hunter circle around their own control wisp?
im pretty sure the jass code would have to be changed too?
if its possible can you look into it?
and if u dont understand i can show u what i mean ><. | |
| | | nomorholywar Sergeant
| Subject: Re: How To Make A Wisp Wheel Mon Dec 28, 2009 4:56 pm | |
| - Code:
-
function Trig_Wheel_Actions takes nothing returns nothing
local integer i = 1
loop exitwhen i > 11 call SetUnitX(udg_Wisp[i], GetUnitX(udg_CenterUnit[i]) + udg_Distance*CosBJ(udg_Angle[i])) call SetUnitY(udg_Wisp[i], GetUnitY(udg_CenterUnit[i]) + udg_Distance*SinBJ(udg_Angle[i])) set udg_Angle[i] = udg_Angle[i] + 0.2 set i = i+1 endloop
endfunction | |
| | | Pat1487 Moderator
| Subject: Re: How To Make A Wisp Wheel Mon Dec 28, 2009 5:10 pm | |
| You would need to make an array out of all the demonhunters like you do with the wisps And you would need another Wisp variable and another distance variable so it doesnt conflict with any normal wispwheels you might have in this level Example: - Code:
-
Events Unit enters the check that starts the level that has this wisp thing Conditions Actions Set WispC[1] = Wisp 0001 <gen> Set WispC[2] = Wisp 0002 <gen> Set WispC[3] = Wisp 0003 <gen> Set WispC[4] = Wisp 0004 <gen> Set WispC[5] = Wisp 0005 <gen> Set WispC[6] = Wisp 0006 <gen> Set WispC[7] = Wisp 0007 <gen> Set WispC[8] = Wisp 0008 <gen> Set WispC[9] = Wisp 0009 <gen> Set WispC[10] = Wisp 0010 <gen> Set WispC[11] = Wisp 0011 <gen> Set DemonHunter[1] = DemonHunter 0001 <gen> Set DemonHunter[2] = DemonHunter 0002 <gen> Set DemonHunter[3] = DemonHunter 0003 <gen> Set DemonHunter[4] = DemonHunter 0004 <gen> Set DemonHunter[5] = DemonHunter 0005 <gen> Set DemonHunter[6] = DemonHunter 0006 <gen> Set DemonHunter[7] = DemonHunter 0007 <gen> Set DemonHunter[8] = DemonHunter 0008 <gen> Set DemonHunter[9] = DemonHunter 0009 <gen> Set DemonHunter[10] = DemonHunter 0010 <gen> Set DemonHunter[11] = DemonHunter 0011 <gen> Set Distance2 = 150
Make sure Wisp[1] and Demonhunter[1] both belong to player 1 (Wisp[2] and DemonHunter[2] should both belong to player 2 and so on) And make sure to remove the wisps that belong to players who arent in the game like you do with demonhunters Then copy the whole jass trigger into a new trigger, rename it to something else, turn it off initially, and turn it on when they get to the level that has this thing (turn it off again when your done with it) In the new jass trigger that you copied and renamed, change the lines like this: exitwhen i > 11call SetUnitX( udg_DemonHunter[i], GetUnitX(udg_WispC[i]) + udg_Distance2*CosBJ(udg_Angle[ 1])) call SetUnitY( udg_DemoHunter[i], GetUnitY(udg_WispC[i]) + udg_Distance2*SinBJ(udg_Angle[ 1])) That would make each players demonhunter rotate around the wisp that they own in sync with everyone (you can keep Angle[i] if you dont want them all in sync) Its basically what nomor said, just explained more for what your trying to do Or at least thats what i think your trying to do | |
| | | AmAzIn[G] Commander
| Subject: Re: How To Make A Wisp Wheel Fri Jan 01, 2010 2:11 pm | |
| Ok i dont know if this is what u ment for me 2 do but this is what i came up with. Is it possible for me to put all of my wisp wheels with in a certain check into one trigger? Sorta like what ive done here? I know the jass would have to be re-written but i think its possible? | |
| | | Pat1487 Moderator
| Subject: Re: How To Make A Wisp Wheel Fri Jan 01, 2010 3:35 pm | |
| - Spoiler:
Lmao That picture Cant resist So many ways to make fun of it/you:
1. Why would you black out the little arrow that unhides the tray icons on the task bar, you didnt even black out the circular button part, its like your censoring out a nipple or something 2. Why did you black out the time, Im going to have to assume you did this at 11:30pm last night and you dont want us to know that you were at home making a map instead of being at a new years eve party 3. Why is penis written on there, like that, it looks like a 3 year old with adhd and turrets drew the word 4. Why did you black out the minimize button and the close button at the top right, now im starting to think you have some sort of UI mod for windows xp that turns your buttons into something homosexual 5. Why did you black out the other windows on the taskbar, are you trying to hide gay porn or meatspin.com? 6. Why did you black out that random space on the task bar between the arrow button and the other windows, is it another part of your homosexual windows xp mod?
What you want is known as a multidimensional array, and it doesnt exist in jass You can sorta fake one though (not really) Lets say you want 4 wheels in the same level The first wheel would use wisp[], angle[], centerarray[1], distancearray[], num[1] The second wheel could use wisp2[], angle2[], centerarray[2], distancearray2[], num[2] The 3rd could be wisp3[], angle3[], centerarray[3], distancearray3[], num[3] And the forth wisp4[], angle4[], centerarray[4], distancearray4[], num[4] A blank array index means you fill each one in for every wisp you have in the wheel and where you want it Make sure you set everything right, like centerarray[1] is the center of the first wheel and so on, num[1] is the number of wisps in your first wheel and so on Then you would change the original jass trigger to: - Code:
-
function Trig_Wheel_Actions takes nothing returns nothing
local integer i = 1 local integer j = 1 local integer k = 1 local integer l = 1
loop exitwhen i > udg_Num[1] call SetUnitX(udg_Wisp[i], GetRectCenterX(CenterArray[1]) + udg_DistanceArray[i]*CosBJ(udg_Angle[i])) call SetUnitY(udg_Wisp[i], GetRectCenterY(CenterArray[1]) + udg_DistanceArray[i]*SinBJ(udg_Angle[i])) set udg_Angle[i] = udg_Angle[i] + 0.2 set i = i+1 endloop
loop exitwhen j > udg_Num[2] call SetUnitX(udg_Wisp2[j], GetRectCenterX(CenterArray[2]) + udg_DistanceArray2[j]*CosBJ(udg_Angle2[j])) call SetUnitY(udg_Wisp2[j], GetRectCenterY(CenterArray[2]) + udg_DistanceArray2[j]*SinBJ(udg_Angle2[j])) set udg_Angle2[j] = udg_Angle2[j] + 0.2 set j = j+1 endloop
loop exitwhen k > udg_Num[3] call SetUnitX(udg_Wisp3[k], GetRectCenterX(CenterArray[3]) + udg_DistanceArray3[k]*CosBJ(udg_Angle3[k])) call SetUnitY(udg_Wisp3[k], GetRectCenterY(CenterArray[3]) + udg_DistanceArray3[k]*SinBJ(udg_Angle3[k])) set udg_Angle3[k] = udg_Angle3[k] + 0.2 set k = k+1 endloop
loop exitwhen l > udg_Num[4] call SetUnitX(udg_Wisp4[l], GetRectCenterX(CenterArray[4]) + udg_DistanceArray4[l]*CosBJ(udg_Angle4[l])) call SetUnitY(udg_Wisp4[l], GetRectCenterY(CenterArray[4]) + udg_DistanceArray4[l]*SinBJ(udg_Angle4[l])) set udg_Angle4[l] = udg_Angle4[l] + 0.2 set l = l+1 endloop
endfunction
//=========================================================================== function InitTrig_Wheel takes nothing returns nothing set gg_trg_Wheel = CreateTrigger( ) call DisableTrigger( gg_trg_Wheel ) call TriggerRegisterTimerEventPeriodic( gg_trg_Wheel, 0.01 ) call TriggerAddAction( gg_trg_Wheel, function Trig_Wheel_Actions ) endfunction Instead of 4 different letters you could just leave i for all of them as long as you set i back to 1 after each loop I didnt do it like that here cause im not sure it that will work and im not going to test it, but i know for a fact 4 different letters will work You can try just using i and setting it back to 1 if you want, it might work This will work for 4 different wisp wheels, different centers, different distances, different angles, and different numbers of wisps It will also work for wheels that are identical, but its not really needed for those, for those you could just add to the original loop I said it in a general way since idk what you have in mind for it, im assuming you want at least 3 different wheels in 1 level | |
| | | nomorholywar Sergeant
| Subject: Re: How To Make A Wisp Wheel Fri Jan 01, 2010 4:33 pm | |
| what the fuck this is too complicated. just do it without removing leaks. its a maze not dota, nobody can tell unless the game lasts 1hr+
do it in gui with polar offset ! | |
| | | AmAzIn[G] Commander
| Subject: Re: How To Make A Wisp Wheel Fri Jan 01, 2010 4:39 pm | |
| Lol! it isnt that complicated... i think this is actually alot easier rofl! and pat i just put black squares on everything just to make people wonder why the fuck i did it so it should look like this? i dont know how the Num would work. Is it an array, and if it is What is the num equal too. if not then how do i do it? | |
| | | Pat1487 Moderator
| Subject: Re: How To Make A Wisp Wheel Fri Jan 01, 2010 7:22 pm | |
| I didnt say thats how i would do it Personally I would do it like this: - Code:
-
function Trig_Wheel_Actions takes nothing returns nothing
local integer i = 1 local integer j = 1
loop exitwhen j > udg_TotalNumberOfWispsInWheelsThisLevel loop exitwhen i > (udg_TotalNumberOfWispsInWheelsThisLevel/udg_TotalNumberOfWispWheelsThisLevel) call SetUnitX(udg_Wisp[i], GetUnitX(udg_CenterUnit[j]) + udg_Distance[i]*CosBJ(udg_Angle[i])) call SetUnitY(udg_Wisp[i], GetUnitY(udg_CenterUnit[j]) + udg_Distance[i]*SinBJ(udg_Angle[i])) set udg_Angle[i] = udg_Angle[i] + udg_Speed[j] set i = i+1 endloop set j = j + 1 endloop
endfunction I didnt say this though because idk if it works, i havent tested it There might be something wrong with it It would force me to put an equal number of wisps in each wheel in each level, but should work Example: You set 16 wisps to an array Set 4 center units to an array to be the center of each wheel Set 4 speeds to an array for each wheel set the angle to an array for each wisp Set the distance to an array for each wisp Set the total number of wisps to a variable Set the total number of wheels to a variable The function takes the first wheel puts the first 4 wisps/distance/angle into that wheel, and makes it rotate around the first center unit with the first speed Then moves on to the next wheel with the next 4 wisps/distance/angle center unit and speed Then the 3rd wheel and so on You would have to use multiples though If you want 3 wheels you need enough wisps so that 3 can be divided into them, so you couldnt have a wheel with 4 whisps and 1 with 5 in the same level for example, 3 wheels of 4 wisps would need 12 wisps or 3 wheels of 5 wisps would need 15, you cant use 14 and get 2 wheels with 5 wisps and 1 wheel with 4 wisps, youd end up with 3 wheels of 4 wisps with 3 wisps left over (since it rounds down) | |
| | | AmAzIn[G] Commander
| Subject: Re: How To Make A Wisp Wheel Fri Jan 01, 2010 7:48 pm | |
| That's stupid then lol...
That's almost counter productive...
i want a wisp wheel with 3 wisps in it, and a wisp wheel with 1 wisp in it, all in the same level. Your pretty much telling me i cant do that, but i know for a fact i can !!! wtf lol.. | |
| | | Pat1487 Moderator
| Subject: Re: How To Make A Wisp Wheel Fri Jan 01, 2010 9:37 pm | |
| You cant do that with the last trigger i posted The other one (the longer one) you can
Youd might as well do what nomor said and just stick with gui for everything If you cant modify nomor's original wisp jass trigger to do what you want on your own then jass just isnt for you
Nomors original trigger was designed to be 1 whispwheel per level, with any type of rotation, speed, distance, and angle you wanted
The next one (nomors and mine) was to have 11 wisps rotating around 11 demonhunters (or any center unit)
Mine after that (the long one) was designed to have 4 whispwheels per level all with different settings
The one after that is how i would do a wispwheel in jass, allowing for any number of wheels you want per level as long as they had an equal number of wisps per wheel for creating several wheels at once quickly (needs testing)
All are based on nomors original 1 wheel per level trigger and all accomplish different things
If you use modulus division ( i dont think jass has a mod operand though, but i remember there was a formula to figure it out without the need for a mod operand, i cant remember it right now though) in my most recent trigger to get the remainder of wisps that are left over when it divides numbers that dont go in evenly, and keep looping until there is no remainder, then put those into wheels, you might be able to make a wheel with 3 wisps and another with 1 The closest you would get is with 3 wheels while only having a total of 5 wisps, you would end up with 1 wheel of 3 wisps and 2 wheels of 1 wisp
But since you didnt understand any of what i just said, just use gui Cause your just going to keep needing different types of wispwheels and will always be asking us then when we attempt to make one you say:
"No, i need it to spin backwards with a wave like effect in the wheel and every 3rd wisp moves in its own small wheel, but not the 9th wisp, that one disappears and reappears at random, but not completely random, more like on a timer that has a set but random range that changes on each reappearance, and theres 4 spokes to that wheel, oh and that wheel is rotating in a larger wheel with 4 other wheels that are exactly like it but arent in that they spin at different randomly changing random speeds"
Ok, you probably wont ask for something that ridiculous, but you know what i mean Use gui | |
| | | AmAzIn[G] Commander
| Subject: Re: How To Make A Wisp Wheel Fri Jan 01, 2010 10:30 pm | |
| Ok pat, your not giving me enough credit lol. I do know some jass jeeze.
And i know how to make a wisp wheel spin backwords, and make another wisp wheel within another (in gui only tho).
Its just i cant seem to understand why You must have 4 wisps in one wheel and 3 wheels to make twelve. You say it has something to do with the loop. I mean i do sort of understand it, because variables can only be used for one thing at a time and i can see how it would clash.
But i know theirs a much easier way to have multiple wisp wheels in a check. And generally new gen jass is easier to do than gui triggering, atleast it is to me, and my experiences.
i guess i can play around with it until i figure a way :/. | |
| | | Pat1487 Moderator
| Subject: Re: How To Make A Wisp Wheel Sat Jan 02, 2010 11:41 am | |
| - AmAzIn[G] wrote:
- Ok pat, your not giving me enough credit lol. I do know some jass jeeze.
And i know how to make a wisp wheel spin backwords, and make another wisp wheel within another (in gui only tho).
Its just i cant seem to understand why You must have 4 wisps in one wheel and 3 wheels to make twelve. You say it has something to do with the loop. I mean i do sort of understand it, because variables can only be used for one thing at a time and i can see how it would clash.
But i know theirs a much easier way to have multiple wisp wheels in a check. And generally new gen jass is easier to do than gui triggering, atleast it is to me, and my experiences.
i guess i can play around with it until i figure a way :/. new gen jass and normal jass is the same New gen has built in stuff to make it easier then normal jass though, but not easier then normal gui If you want nomors trigger to work with more then one wheel you need copies of everything for as many wheels as you want So 2 wheels would need 2 copies of the loop (or 2 copies of the trigger if thats easier for you) And 2 copies of the variables That would be the easiest way to make more then 1 wheel, with different settings for each wheel, with nomors trigger If you cant even get that to work then just use gui | |
| | | AmAzIn[G] Commander
| Subject: Re: How To Make A Wisp Wheel Sun Feb 14, 2010 7:22 pm | |
| Ok i understand this alot better now lol!
pat or arun can one of you rewrite the jass as a distancearray, because the trigger wasn't originally written for a "Distance Array". | |
| | | Sponsored content
| Subject: Re: How To Make A Wisp Wheel | |
| |
| | | | How To Make A Wisp Wheel | |
|
Similar topics | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| |