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 |
|
| | Hello all ! I Have questions ! You got answers ! | |
| | Author | Message |
---|
RKR. Recruit
| Subject: Hello all ! I Have questions ! You got answers ! Tue Jun 28, 2011 8:32 pm | |
| 1. Why I putted Locust as abillity in Object Editor and I still see my units in my map. 2. I wanna do Boost Slide trigger like in Maze of fantasy or Maze of glory or whatever Like Hero Enter Region Slide To The other ! without clicking. 3. How I can Slide my brown units as Patrol ! Like wisp wheel , but I wanna put for example : Footman and make it slide and patrol to another region ? 4. How I Make the Camera Turning around Hero like in A Short Maze , when Unit enter region camera begin to turn around him . That Was My Questions ! And The futures post is your answers ... Thank You Very Much For your best answers ! | |
| | | AmAzIn[G] Commander
| Subject: Re: Hello all ! I Have questions ! You got answers ! Tue Jun 28, 2011 9:57 pm | |
| - RKR. wrote:
4. How I Make the Camera Turning around Hero like in A Short Maze , when Unit enter region camera begin to turn around him . That Was My Questions ! And The futures post is your answers ... Thank You Very Much For your best answers ! I'd have to research the other questions (but they are on this forum somewhere if you look hard enough) This question in particular though is very simple. I'm not very good with triggering and this is easy even for me. All you need to do is look at "Camera" in the trigger editor for actions and you will find out how to do this pretty easily, just mess around with it. It's always more fun doing things yourself when you know you can do them. | |
| | | RKR. Recruit
| Subject: Re: Hello all ! I Have questions ! You got answers ! Tue Jun 28, 2011 11:39 pm | |
| - AmAzIn[G] wrote:
- RKR. wrote:
4. How I Make the Camera Turning around Hero like in A Short Maze , when Unit enter region camera begin to turn around him . That Was My Questions ! And The futures post is your answers ... Thank You Very Much For your best answers ! I'd have to research the other questions (but they are on this forum somewhere if you look hard enough)
This question in particular though is very simple. I'm not very good with triggering and this is easy even for me. All you need to do is look at "Camera" in the trigger editor for actions and you will find out how to do this pretty easily, just mess around with it. It's always more fun doing things yourself when you know you can do them. ty ^_^ | |
| | | RKR. Recruit
| Subject: Re: Hello all ! I Have questions ! You got answers ! Wed Jun 29, 2011 9:45 am | |
| - RKR. wrote:
- 1. Why I putted Locust as abillity in Object Editor and I still see my units in my map.
^_^ I found the problem haha ! | |
| | | Serenity09 Moderator
| Subject: Re: Hello all ! I Have questions ! You got answers ! Wed Jun 29, 2011 9:42 pm | |
| i wanna clarify a few things. im gonna skip over 1 since it sounds like you figured it out
2. a boost as in the slide speed increases or a "boost" that prevents the mazers from turning?
3. so you want a unit's path to include some parts patrol and some parts more of a circular wisp wheel type thing? for this type of thing you'd have to do each part of the path individually ie. unit enters loc1 order unit to move to loc2
unit enters loc2 call wispwheel(enteringunit)
unit enters loc3 order unit to move to loc1
all in all its a lot more trouble to do than its worth
you could make a jass function which took two regions and generated the "wisp-wheel-like" movement you wanted this would be easier, but still alotta work for a few interesting patrols
4. i need to do something like this in my maze i haven't done it yet so im not sure exactly how to do it but what i'm going to try first is: nvm its actually more complicated than i thought itd be i'll post my code and you can just copy and paste it when i finish i'll try to do it today/tmrrw | |
| | | RKR. Recruit
| Subject: Re: Hello all ! I Have questions ! You got answers ! Wed Jun 29, 2011 9:50 pm | |
| - Serenity09 wrote:
- i wanna clarify a few things. im gonna skip over 1 since it sounds like you figured it out
2. a boost as in the slide speed increases or a "boost" that prevents the mazers from turning?
3. so you want a unit's path to include some parts patrol and some parts more of a circular wisp wheel type thing? for this type of thing you'd have to do each part of the path individually ie. unit enters loc1 order unit to move to loc2
unit enters loc2 call wispwheel(enteringunit)
unit enters loc3 order unit to move to loc1
all in all its a lot more trouble to do than its worth
you could make a jass function which took two regions and generated the "wisp-wheel-like" movement you wanted this would be easier, but still alotta work for a few interesting patrols
4. i need to do something like this in my maze i haven't done it yet so im not sure exactly how to do it but what i'm going to try first is:
nvm its actually more complicated than i thought itd be i'll post my code and you can just copy and paste it when i finish i'll try to do it today/tmrrw ty ^_^ i dont really understand for the 3 ! but the 2 is a slide trigger like in mof2 when hero enter region he begin to slide fast to another ! i copied trigger from mog3 but i get an error witht eh custom script lol ... and i have another question : I putted locust and the thing to kill on all brown units ? but only 2 units kill me lol idk why .... | |
| | | AmAzIn[G] Commander
| Subject: Re: Hello all ! I Have questions ! You got answers ! Wed Jun 29, 2011 9:56 pm | |
| - RKR. wrote:
- and i have another question : I putted locust and the thing to kill on all brown units ? but only 2 units kill me lol idk why ....
You have to give the units permanent immolation and change the damage to like 9999. They don't have a collision when they are locused. | |
| | | RKR. Recruit
| Subject: Re: Hello all ! I Have questions ! You got answers ! Wed Jun 29, 2011 10:24 pm | |
| - AmAzIn[G] wrote:
- RKR. wrote:
- and i have another question : I putted locust and the thing to kill on all brown units ? but only 2 units kill me lol idk why ....
You have to give the units permanent immolation and change the damage to like 9999. They don't have a collision when they are locused. ty but already putted permanent imolation ... =/ | |
| | | AmAzIn[G] Commander
| Subject: Re: Hello all ! I Have questions ! You got answers ! Thu Jun 30, 2011 12:25 am | |
| - RKR. wrote:
- AmAzIn[G] wrote:
- RKR. wrote:
- and i have another question : I putted locust and the thing to kill on all brown units ? but only 2 units kill me lol idk why ....
You have to give the units permanent immolation and change the damage to like 9999. They don't have a collision when they are locused. ty but already putted permanent imolation ... =/ Well check again bitch. | |
| | | Serenity09 Moderator
| Subject: Re: Hello all ! I Have questions ! You got answers ! Thu Jun 30, 2011 10:14 am | |
| post your slide trigger and i can show you how to do number 2
the part about only 2 units killing you is cuz immolation sucks dick probably you need to change the range of the ability so its big enough to hit any unit that comes close enough
dont worry about 3 its too much trouble for what its worth or if you really want it, finish everything else then come back to it | |
| | | Race Recruit
| Subject: Re: Hello all ! I Have questions ! You got answers ! Fri Jul 01, 2011 2:36 am | |
| btw guys i know i havent been on the forums but fermee asked me to look so i did. btw if any of you play sc2 id be happy to play with you
1. Import AbilityData.slk --- Ask me for the file and change the import path to "Units\AbilityData.slk"
2. I have functions if you want them. and if you're interested, i can teach you how i did the slide on my map so you can learn from it. also if you want to have a good maze, use newgen editor
3. Those sliding patrols...i think i know what you're talking about, its actually a wisp wheel but with no y axis (or x axis) so whoever made it would make the distance 0 or whatever. i have wisp wheels like that if you want me to give them to you and if you want to learn from them i can also show you how to do them and stuffz
4. for the camera spin, you can simply do a periodic trigger which sets the camera to above a unit and make a variable that increases or decreases and then set the turn to that value. if you dont understand i could always just show you what i mean because this is the way i think before i make a part in my mazes which are complicated.
ppl from tmmm -> dont hate me plz
so...
-Get Newgen -Ask me for help if i ever have time
you are asking for complicated stuff and at your level or triggering i dont think you can fully understand everything. not criticizing, just trying to help | |
| | | Serenity09 Moderator
| Subject: Re: Hello all ! I Have questions ! You got answers ! Fri Jul 01, 2011 9:20 am | |
| see guys he hasnt been on the forum in like a year and he still remembers his password - Quote :
- 4. for the camera spin, you can simply do a periodic trigger which sets the camera to above a unit and make a variable that increases or decreases and then set the turn to that value. if you dont understand i could always just show you what i mean because this is the way i think before i make a part in my mazes which are complicated.
raaaawr that would have been so much easier than how i did it fdsajkl | |
| | | AmAzIn[G] Commander
| Subject: Re: Hello all ! I Have questions ! You got answers ! Fri Jul 01, 2011 11:42 am | |
| lol seren I even do that for camera spins. | |
| | | RKR. Recruit
| Subject: Re: Hello all ! I Have questions ! You got answers ! Fri Jul 01, 2011 7:42 pm | |
| ty dark and yes i will need your help ^_^ but where i can get newgen :O ? | |
| | | Serenity09 Moderator
| Subject: Re: Hello all ! I Have questions ! You got answers ! Fri Jul 01, 2011 11:15 pm | |
| herei didn't do it with that guide, but from what i read it looked better then the one i used | |
| | | RKR. Recruit
| Subject: Re: Hello all ! I Have questions ! You got answers ! Sat Jul 02, 2011 1:14 am | |
| | |
| | | Serenity09 Moderator
| Subject: Re: Hello all ! I Have questions ! You got answers ! Sat Jul 02, 2011 11:47 pm | |
| ok it took me 2 days to do but its pretty sweet i'm planning on releasing all the little cool things i made for the map after its finished but here's the camera thing test map is here and yes, i did give it 5 stars. in the end i don't think i'm even gonna use it in my map but ah well, i learned a lot while doing it if youre interested in just the code: - Spoiler:
- Code:
-
library ListModule //=========================================================================== // Information: //============== // // This library provides the List module, which allows you to easily create // a linked list of all of the allocated instances of a struct-type. Iterating // through a linked list is about 12% faster than iteratating through an array // in JASS. There is no faster method to iterate through a list of structs than // the method used by this module. Aside from the marginal speed gain, the best // use of this library is to hide some ugly low-level code from your structs. // Rather than manually building and maintaining a list of struct instances, // just implement the List module, and your code will become much prettier. // //=========================================================================== // How to use the List module: //============================= // // Using the List module is pretty simple. First, implement it in your // struct (preferably at the top to avoid unnecessary TriggerEvaluate calls). // In the struct's create method, you must call listAdd(). In the onDestroy // method, you must also call listRemove(). An example is shown below: /* struct Example implement List static method create takes nothing returns Example local Example this = allocate() call listAdd() //This method adds the instance to the list. return this endmethod method onDestroy takes nothing returns nothing call listRemove() //This method removes the instance from the list. endmethod endstruct */ // The requirement to call listAdd() and listRemove() will be done away // with once JassHelper supports module onDestroy and module onCreate, but // for now, it is not too much of a burden. // // Once this is done, your struct will gain all of the methods detailed // in the API section. Below is an example of how to iterate through the list // of allocated structs of the implementing struct-type: /* function IterationExample takes nothing returns nothing local Example e = Example.first loop exitwhen e == 0 //Do something with e here. set e = e.next endloop //Use .last and .prev instead to iterate backwards. endmethod */ // //=========================================================================== // List module API: //================== // // (readonly)(static) first -> thistype // This member contains the first instance of thistype in the list. // // (readonly)(static) last -> thistype // This member contains the last instance of thistype in the list. // // (readonly)(static) count -> integer // This member contains the number of allocated structs of thistype. // // (readonly) next -> thistype // This member contains the next instance of thistype in the list. // // (readonly) prev -> thistype // This member contains the previous instance of thistype in the list. // // listAdd() // This method adds this instance to the list of structs of thistype. // This should be called on each instance after it is allocated (within // the create method). // // listRemove() // This method removes this instance from the list of structs of thistype. // This should be called on each instance before it is destroyed (within // the onDestroy method). // // (static) listDestroy() // This method destroys all the structs of thistype within the list. // //===========================================================================
module List private static boolean destroying = false private boolean inlist = false readonly static integer count = 0 readonly thistype next = 0 readonly thistype prev = 0 static method operator first takes nothing returns thistype return thistype(0).next endmethod static method operator last takes nothing returns thistype return thistype(0).prev endmethod method listRemove takes nothing returns nothing if not inlist then return endif set inlist = false set prev.next = next set next.prev = prev set count = count - 1 endmethod
method listAdd takes nothing returns nothing if inlist or destroying then return endif set inlist = true set last.next = this set prev = last set thistype(0).prev = this set count = count + 1 endmethod static method listDestroy takes nothing returns nothing local thistype this = last set destroying = true loop exitwhen this == 0 call destroy() set this = prev endloop set destroying = false endmethod endmodule
endlibrary
- Code:
-
library CameraLibrary requires ListModule //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Rotation Camera // by Serenity09 @ USEAST // ListModule by Grim001 (give credit to him) // Clan TMMM // Purpose: // Creates a structure which rotates "randomly" around a given unit for a given player //==================================================================================== // Configuration: // Change the values of the global variables to be as you want, recommended values are given // descriptions of what each variable does is given by the comment directly above the variable //============================================================================================ // Importing: // This library requires ListModule. Either import ListModule manually, or copy and paste the Libraries folder located in the test map // All global variables must have a value. Some must be set in a separate trigger at map init (like CamUnit) // If being used in a maze, you most likely have an array which contains all the mazers - if this is the case // you should replace the CamUnit array with your own. // Because this uses libraries and structs, this requires JASS newGen editor to compile. //====================================================================================== // Expanded API: (functions available to this struct) + explanations // // .create(integer i, unit u) -> RotationCamera // creates a camera for Player(i) centering around unit u // if ROTATEONCREATE in the configurables section is set to true, then the camera will begin rotation immediately // // .destroy() -> nothing // deallocates the RotationCamera object as well as: // nulling member variables, resetting default camera for owning player, stopping camera rotation. // // .CamStart() -> nothing // resumes rotation for a previously created camera. camera MUST exist already. // // .CamStop() -> nothing // stops rotation for an existing camera. however this does not destroy the camera. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// globals //CONFIGURABLES //should this run in debug mode? //only for testing (debug messages leak) private constant boolean CAMDEBUG = false //the timer used for the periodic function private timer CamTimer = CreateTimer() //should the rotation direction alternate or be random? private constant boolean CAMALTERNATEDIR = true //should cameras start rotating as soon as they are created? private constant boolean ROTATEONCREATE = true //how often the periodic trigger is run, higher means less memory intensive but choppier movement private constant real HowOften = .05 //bounds for cam rotation speed private constant real LeastCamSpeed = .5 private constant real MostCamSpeed = 5 //bounds for rotation duration private constant integer LeastCamTicks = 50 private constant integer MostCamTicks = 200 //dont touch below here unless you know what you're doing
endglobals
struct RotationCamera //an array that stores previous camera angles private real CurCamAngle //how many ticks are left going in this direction private integer CamNumTicks //true == clockwise, false == counterclockwise private boolean CamRotationDirection //the speed for the camera private real CamRotationSpeed //the current camera private camerasetup CurCam //who does this camera belong to private player CamOwner //which unit does the camera center on private unit CamUnit private method CamRandGenerate takes nothing returns nothing //generates a new random set of paramaters which replace the previous ones set CamNumTicks = GetRandomInt(LeastCamTicks, MostCamTicks) set CamRotationSpeed = GetRandomReal(LeastCamSpeed, MostCamSpeed) static if CAMALTERNATEDIR then set CamRotationDirection = not CamRotationDirection else set CamRotationDirection = (GetRandomInt(0, 1) == 0) endif //debug stuff static if CAMDEBUG then call DisplayTextToForce(bj_FORCE_PLAYER[GetPlayerId(GetOwningPlayer(CamUnit))], "New Parameters") call DisplayTextToForce(bj_FORCE_PLAYER[GetPlayerId(GetOwningPlayer(CamUnit))], "Num Ticks: " + I2S(CamNumTicks)) call DisplayTextToForce(bj_FORCE_PLAYER[GetPlayerId(GetOwningPlayer(CamUnit))], "Rotation Speed: " + R2S(CamRotationSpeed)) if CamRotationDirection then call DisplayTextToForce(bj_FORCE_PLAYER[GetPlayerId(GetOwningPlayer(CamUnit))], "Rotate Clockwise") else call DisplayTextToForce(bj_FORCE_PLAYER[GetPlayerId(GetOwningPlayer(CamUnit))], "Rotate Counter-Clockwise") endif endif
endmethod private method CamRotate takes nothing returns nothing //if the camera has finished its rotation period then its time to generate a new set of parameters if CamNumTicks < 1 then call CamRandGenerate() //otherwise keep rotating the camera with the existing parameters else //clockwise or counterclockwise? might be easier for CamRotationDirection to just be -1 or 1. if CamRotationDirection then set CurCamAngle = CurCamAngle - CamRotationSpeed else set CurCamAngle = CurCamAngle + CamRotationSpeed endif //prevents super big reals if CurCamAngle > 360 then set CurCamAngle = CurCamAngle - 360 elseif CurCamAngle < 0 then set CurCamAngle = CurCamAngle + 360 endif //set the angle for the camera field call CameraSetupSetField(CurCam, CAMERA_FIELD_ROTATION, CurCamAngle, HowOften) call CameraSetupSetDestPosition(CurCam, GetUnitX(CamUnit), GetUnitY(CamUnit), HowOften) //apply the new angle/camera for the specified person if GetLocalPlayer() == CamOwner then call CameraSetupApply(CurCam, false, false) call PanCameraToTimed(GetUnitX(CamUnit), GetUnitY(CamUnit), HowOften) endif //decrement the number of ticks remaining for these parameters set CamNumTicks = CamNumTicks - 1 endif endmethod implement List //iterates through the list of cameras calling the rotation function private static method periodic takes nothing returns nothing local RotationCamera e = .first loop exitwhen e == 0 call e.CamRotate() set e = e.next endloop endmethod //start a camera given a previously stopped camera. //Cannot start a destroyed camera, if you destroy a camera you need to .create a new one to replace it public method CamStart takes nothing returns nothing call .listAdd() endmethod //stops a camera while leaving the RotationCamera object intact public method CamStop takes nothing returns nothing call .listRemove() endmethod //initializes all the data fields for the rotating camera object //no rotation is actually done here public static method create takes integer WhosCamId, unit whichCamUnit returns RotationCamera local RotationCamera new = RotationCamera.allocate() set new.CamOwner = Player(WhosCamId) set new.CamUnit = whichCamUnit set new.CurCamAngle = 0 set new.CurCam = CreateCameraSetup() //generates and sets the parameters for the camera call new.CamRandGenerate() //if true, the camera will begin rotating immediately for the given player static if ROTATEONCREATE then call new.listAdd() endif call TimerStart(CamTimer, HowOften, true, function RotationCamera.periodic) return new endmethod private method onDestroy takes nothing returns nothing //remove this camera from the list call .listRemove() //if no camera is being rotated, then pause the timer if .count == 0 then call PauseTimer(CamTimer) endif //resets the game camera to default for given player if GetLocalPlayer() == CamOwner then call ResetToGameCamera(3.00) endif //null handle member variables set CamOwner = null set CurCam = null endmethod endstruct
endlibrary basic use in a 10 player map (only did 2 units cuz i'm lazy) - Code:
-
globals //how many people play (at most) constant integer NumberPlayers = 10 //used to access the different cameras RotationCamera array RotCameras[NumberPlayers] //array for all the units which are "attached" to the camera unit array CamUnit[NumberPlayers] endglobals
//=========================================================================== function InitTrig_CamTest takes nothing returns nothing local integer i = 0 set CamUnit[0] = gg_unit_Hblm_0000 set CamUnit[1] = gg_unit_Hblm_0003 set gg_trg_CamTest = CreateTrigger( ) loop exitwhen i > NumberPlayers - 1 if GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then set RotCameras[i] = RotationCamera.create(i, CamUnit[i]) endif set i = i + 1 endloop endfunction
why is this better than what dark or amaz do? general answer: its not really, aside from ease of use (after installation) and being leakless - it has only slightly more immediate functionality answer for people who know jass: another minute of coding get/set functions and internalizing some of the global limits and this system is ridiculously flexible like having the equivalent of ice boosters which slow/increase the speed of the camera rotation temporarily awesome? i think yes the reason the configuration variables are globals rather than members of the struct, is in general all the cam's you make will be the same and that being the case, constant globals perform drastically better i'll release the more flexible version with everything else (not till the 16th ish) | |
| | | AmAzIn[G] Commander
| Subject: Re: Hello all ! I Have questions ! You got answers ! Sun Jul 03, 2011 10:32 am | |
| Wow Seren this must be a huge accomplishment for you. | |
| | | Sponsored content
| Subject: Re: Hello all ! I Have questions ! You got answers ! | |
| |
| | | | Hello all ! I Have questions ! You got answers ! | |
|
Similar topics | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| |