wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Tutorials > JASS/AI scripts tutorials
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 11-09-2007, 06:31 AM   #91
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,514

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

Quote:
Originally Posted by darkwulfv
Well, I don't use VJass, and idk if Wyrmlord does, so we wouldn't be the ones to do it. (I could personally use a Vjass tutorial)

And you couldn't find those...?
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.

Last edited by Pyrogasm : 11-09-2007 at 06:32 AM.
Pyrogasm is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 11-09-2007, 11:15 AM   #92
darkwulfv
Alpha Male of Wc3c
 
darkwulfv's Avatar


Official Map Reviewer
 
Join Date: Mar 2006
Posts: 3,646

Submissions (6)

darkwulfv is just really nice (270)darkwulfv is just really nice (270)

Send a message via AIM to darkwulfv
Default

Nope, I never looked. I meant more of a... general vJASS tutorial... Kinda like this one.
__________________
The Spell Request Thread
Quote:
Originally Posted by Joe-Black-5
a dota like map but with unique stuff
(There was no map attached, and that was all the thread said.)
Spells I've Made

Darkwulfv's Lightning Grapple || Tritanis' Lazy Bolt

darkwulfv is offline   Reply With Quote
Old 11-09-2007, 08:01 PM   #93
Salbrismind
User
 
Salbrismind's Avatar
 
Join Date: Aug 2007
Posts: 609

Salbrismind is on a distinguished road (16)

Send a message via Yahoo to Salbrismind
Default

Quote:
Originally Posted by darkwulfv
Oh! There's your issue. Channel turns up invisible unless you tick a certain option in the ability. ('Data - Options' Tick the 'Visible' option.)

Oh, and by the way, Channel isn't that great of a dummy ability. If it's a targeting spell you want, for example, use Acid Bomb with everything set to 0 (or .001 since some things are infinite when set to 0) except mana cost, icon, etc. Basically, make an ability that costs mana, targets, has art, etc. but does nothing. Then just catch the spell being cast and do your scripting.

The same applies for spells that require no target. Use something like Fan of Knives with no missiles.

Channel is a very versatile spell, but it can be a pain to handle if you aren't familiar with it.

Oh, thanks. Maybe you'll want to include a little part in there to warn people of the same mistake.
__________________
Salbrismind is offline   Reply With Quote
Old 11-10-2007, 03:36 AM   #94
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,514

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

Quote:
Originally Posted by darkwulfv
I meant more of a... general vJASS tutorial... Kinda like this one.
The JASSHelper Manual
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm is offline   Reply With Quote
Old 11-24-2007, 09:01 AM   #95
Just call me Js
User
 
Join Date: Nov 2007
Posts: 3

Just call me Js has little to show at this moment (0)

Default

Quote:
Originally Posted by Pyrogasm

Although JASSHelperManual explains what the vJASS stuff are, the problem is the JASSHelperManual doesnt actually tell you how to implement the vJASS to make spells or how to use it effectively.
Just call me Js is offline   Reply With Quote
Old 11-24-2007, 11:18 AM   #96
darkwulfv
Alpha Male of Wc3c
 
darkwulfv's Avatar


Official Map Reviewer
 
Join Date: Mar 2006
Posts: 3,646

Submissions (6)

darkwulfv is just really nice (270)darkwulfv is just really nice (270)

Send a message via AIM to darkwulfv
Default

Second'd on J's post.
__________________
The Spell Request Thread
Quote:
Originally Posted by Joe-Black-5
a dota like map but with unique stuff
(There was no map attached, and that was all the thread said.)
Spells I've Made

Darkwulfv's Lightning Grapple || Tritanis' Lazy Bolt

darkwulfv is offline   Reply With Quote
Old 02-11-2008, 03:51 PM   #97
Jimmarn
User
 
Join Date: Feb 2008
Posts: 4

Jimmarn has little to show at this moment (0)

Default

:S
I think this seemed alittle difficult... think i'll stick to GUI a little more.
Jimmarn is offline   Reply With Quote
Old 11-12-2008, 07:39 AM   #98
Frozenhelfire
User
 
Join Date: Apr 2008
Posts: 49

Frozenhelfire has little to show at this moment (0)

Default

Quote:
So what's the first step to learning JASS?
-Forget everything you know about GUI, except for globals. JASS is far different from GUI, and trying to compare them is a bad idea. However, a good first step is to make some triggers in GUI, then make them JASS. Throw them into JASScraft and have a ball converting BJ's to natives and cleaning leaks. You'll learn fast. It definatly helps the crossover from GUI to JASS.

Actually, I think one shouldn't forget everything about GUI (aside from what you said to remember). I'm still in the process of learning vJass and learning how to use JASS effectively etc. However I still have a lot of use for GUI. I often find myself going back to GUI and converting a few lines into JASS to see an example or find a way of using a function that works. I think that knowing how to do a lot of things in GUI helps my JASS capabilities. I can think of a few examples if you want them.

Anyway, onto the rest of the guide. I think you should explain what handles are in Lesson 6 (the leak lesson). I didn't know what they were before, but you use the word a lot without explaining it and it can be frustrating not knowing what the basics are when trying to learn how to actually use them in a function.

I think you should also make a short lesson on unit groups and using the GroupEnum function(s). Throwing them at us in the final lesson without much explanation is kind of leaving us in the dark. Explaining every major detail before using it in a challenge would probably build a more solid foundation for the guide. Also, a table of contents would be nice :)

I don't really have much to add to the guide. It was pretty solid all around when I glanced over it to see if I was ahead of it or not. Most things were explained in good detail and I think the challenges are a good idea to help people learn and involve them in the process. I haven't looked in this actual thread much, but it would probably be a good idea to include all of the answers in the second post so people can check their work. It wouldn't help if some got off on the wrong foot. The answers would also help someone who is stuck get something to lead them in the right direction.
Frozenhelfire is offline   Reply With Quote
Old 01-03-2009, 07:04 PM   #99
bowzerbro
User
 
bowzerbro's Avatar
 
Join Date: Feb 2007
Posts: 42

bowzerbro has little to show at this moment (0)

Exclamation bowzerbro goes jassing

Updates + Intro
I quit this tut and started on new ones :p
I decided to post w/e problems I find in the tutorial lessons while going through them so that there can be fixes. To people who are doing the tutorial avoid reading this because I'm new to JASS too. Some points may be correct however if no one has confirmed my statements there is a risk that you get confused.
05:05am Jan 4th: Going to sleep. First timestamp used in entire post history
05:12am Jan 4th: Fixed some grammar faults. Actually going to sleep.
05:50am Jan 4th: Success. Updated version of a function used in one of the hidden code snipps. I've yet to go to sleep.
06:17pm Jan 4th: Returns for continued reading. + Added some opinions to Lesson 4 and 5.
Oh man. I had trouble sleeping and didn't go to sleep till around 10am. Lucky someone called or I'd probably wake up around 11pm :p Thus I shall continue.
09:30pm Jan 4th: Okey I sidetracked like hell so I'll get back to topic tomorrow. Possibly. During weeks I usually get too tired to do much. :|
10:47pm Jan 5th: I've not had time today. Possibly tomorrow, though I need to clean apartment so.. :p The next update will be once I've got time to continue.


~ bowzerbro

All lessons - Notes
- How to avoid leaks and such is mentioned early in the tutorial then treated as if it wasn't later on. Repeated mention of leaks and how it gets mentioned later in tutorial confused me through the lessons. Mentioning things outside the objective of the tutorial too often only messes up the process.
- A good way to make an extra end challenge would be not mentioning anything of topic in any lesson such as how to fix leaks. This would add the challenge of fixing them once you've finished the tutorial.

My progress through the tutorial - Will update with everything I find along the way. I'll also include opinions and ideas.

Lesson 1
- The first lesson says to type "call Hello World()" with a space in it. Functions with spaces in them will not work. And even if they did the tutorial tells you to create a function named HelloWorld without a space in it while in the Introduction you are told that any minor error will mess up your code.
Note: Hidden challenge? Then tell me and I will remove or hide the text ;p

Lesson 2
- The second lesson seems alright but I believe it should contain more things to test. A person new to jass would learn more from getting to test more things during progressing through the code and since someone new to jass hasn't learned enough to simply read the code and test it(unless they converted a lot of gui triggers to jass like intro suggests trying) with thing such as;
Collapse JASS:
function variable_test takes nothing returns nothing
 local unit u = CreateUnit()
endfunction
Letting the reader create a footman using the function would be more interesting in my opinion.
A good way to implement this could be by allowing the user to have create one map in the first lesson and linking them by the new functions they learned in previous lessons thus learning how they interact too.
- Give an example unit name such as a footman.
- A simple example to let users trigger the new function.
I mixed the first lesson with the second by doing the following(hidden code If you are doing the tutorial do not unhide this because it may ruin a challenge!!):
Hidden information:
Trigger:
On key up
Collapse Events
Player - Player 1 (Red) Presses the Up Arrow key
Conditions
Collapse Actions
Custom script: call HelloWorld()
Unit - Create 1 Footman for (Triggering player) at (Target of current camera view) facing Default building facing degrees
Custom script: call variable_challenge()
Collapse JASS:
function HelloWorld takes nothing returns nothing
    call BJDebugMsg("Unit created at center of camera view")
endfunction
function variable_challenge takes nothing returns nothing
    local unit u = GetLastCreatedUnit()
    call KillUnit(u)
    set u = null
endfunction

I've got no idea if there's any leak in this code, but I believe since it takes last created units and kills it then sets it to null there shouldn't be.

Lesson 3
Note: I'm still in progress through this lesson but created a custom function before finishing it by converting a GUI trigger to get a method of using return in functions.
Bellow is the hidden code for integrating the function, some explanations and triggers used. Remember that I'm still new and am not sure if the new function leaks since it doesn't remove any values after execution nor does it use any locals.
Hidden information:
Add the following function to custom script:
Collapse JASS:
function EyePosition takes nothing returns string
     return ( R2S(GetCameraTargetPositionX()) + ( "," + R2S(GetCameraTargetPositionY()) ) )
endfunction
- EyePosition function will return x and y of the target of the camera, in other words center of what you currently see. The script uses
return string1 + "," + string2 combines these and returns "string1,string2" (without quotes). Example:
1239.0312,-314.0341
Notice the quotes around the comma sign and the two plus characters, none of these will be returned in the returned string of the function these are there to combine the words. If there is any confusion try changing the "," to " monkey "
The following trigger requires DisplayAMessage function from Lesson 3.
Trigger:
On key up
Collapse Events
Player - Player 1 (Red) Presses the Up Arrow key
Conditions
Collapse Actions
Custom script: call DisplayAMessage(EyePosition())
work.

Note: I'm a bit confused about the challenge here. What am I asked to get the function to do once repaired? Right now I've got no idea what to do because I don't know what outcome is expected after I repaired it. I suggest adding a screenshot or say what is expected to be printed once the function works as intended. I see more than one way of repairing the string but am unsure of which method that is intended.
I am afraid I am missing something if I do not repair the function as intended.

Lesson 4
Quote:
Sometimes, we want to use the loops as a way to do a mass effect spell. If you want to add special effects inside a loop, there is a big chance the code will lag, in order to avoid that, you should use a TriggerSleepAction() function, which will give to the WC3 engine a small break to process other tasks.
In addition to whats written bellow this italic text, I'm not sure but I believe that I've read somewhere that there are better methods to use than TriggerSleepAction() for some reason and possibly preloading various things helps removing occasional lag.
I think this can cause serious problems in triggers though. I experimented using it in a trigger which spawns units at the camera target location then kills them and noticed that the pause doesn't loop in all executed triggers and also the location intended bugs and stays the same as initial location even if I change camera target. I'm probably explaining this bad and I'm not sure how to explain it best but I'll include an example. Example hidden bellow
Hidden information:
Custom code:
Collapse JASS:
function HelloWorld takes nothing returns nothing
    call BJDebugMsg("Unit created at center of camera view")
endfunction
function DisplayAMessage takes string message returns nothing
    call BJDebugMsg(message)
endfunction
function variable_challenge takes nothing returns nothing
    local unit u = GetLastCreatedUnit()
    call KillUnit(u)
    set u = null
endfunction
function EyePosition takes nothing returns string
     return ( R2S(GetCameraTargetPositionX()) + ( " , " + R2S(GetCameraTargetPositionY()) ) )
endfunction
function Waitlol takes nothing returns nothing
    call TriggerSleepAction(5.00)
    call BJDebugMsg("OMG")
endfunction
Triggers:
Trigger:
On key up
Collapse Events
Player - Player 1 (Red) Presses the Up Arrow key
Conditions
Collapse Actions
Custom script: call Waitlol()
Custom script: call Function2("mmm, candy!")
Custom script: call HelloWorld()
Custom script: call DisplayAMessage(EyePosition())
Unit - Create 1 Footman for (Triggering player) at (Target of current camera view) facing Default building facing degrees
Custom script: call variable_challenge()

Moving the wait trigger down solved the problem I think but I keep the text here for comments.

Currently stuck due to problems making sense out of how ModoloInteger() works. Attempts hidden to avoid confusing people currently going through tutorial.
Semi-Concluded:
- Add how to combine strings such as set x = ( x + ", " + I2S(y) ) where x is a string and y is integer
- Add better explanations on how to use various functions in the exercise.
* Update Jan 4th@18pm: Good lesson, good objectivity and fairly understandable. Only a few things which could be improved in my opinion.
- Design could be improved, such wc3c-style would be easier to read all the white annoys my eyes. (whole bunch of tutorials)
Hidden information:
ModoloInteger(x,y) = z
x , y = z
12,12 = 0
12,11 = 1
12,10 = 2
12,9 = 3
12,8 = 4
12,7 = 5
12,6 = 0
12,5 = 2
12,4 = 0
12,3 = 0
12,2 = 0
12,1 = 0

Please explain how this makes any sense. :|
I thought it made some sense till 6.
12x1+12 would give 24 which would give 0 difference if it was going in circles from 1 to 12
but then 12,6 would give 6 since 6 later there would be 6 left till 12 would get struck again.
I don't see any way to use this table to get the desired pattern to show.
~about an hour later~
I've now found a way to get a pattern somewhat close to desired.
Collapse JASS:
function DivideNumbers takes integer n returns nothing
 local string s = null
 local integer i = n
 local integer j
 loop
 exitwhen i == 0
 set j = n/i
  if j > 0. then
   if s == null then
   set s = I2S(j)
   else
   set s = ( s + ", " + I2S(j) )
  endif
  endif
 set i = i - 1
 endloop
 call DisplayAMessage(s)
endfunction
I got stuck for a while until I noticed that set a = b/(c-d) will set c to c-d or something like that, since in my confusion I decided to put set j = n/(i-1) which made the loop bug after reaching 1 and then became unable to reach 0.. I think.
Anyway the script returns something close to what was wanted in exercise but I've yet to figure how to filter values out. I don't think the challenge in Lesson 4 is of as much help as it can confuse you. I say after about 4 hours on the same problem I've spent a lot of time on something that should have been better explained or had more exercises to build up knowledge to then do the finals. I should have posted "Please add more information about methods to solve the challenge" or something and just gone to sleep earlier. :|

- Challenge now solved using custom method People doing tutorial are recommended to not unhide:
Hidden information:
Code has yet to be optimized:
Collapse JASS:
function DivideNumbers takes integer n returns nothing
 local string s = null
 local real i = n
 local real j = 0
 local real k = 0
 loop
 exitwhen i == 0
 set j = I2R(n)/i
 set k = (j-R2I(j))
  if k == 0 then
   if s == null then
   set s = I2S(R2I(j))
   else
   set s = ( s + ", " + I2S(R2I(j)) )
  endif
  endif
 set i = i - 1
 endloop
 call DisplayAMessage(s)
endfunction


Lesson 5
Quote:
Delete all the code and make a new function that has the name: InitTrig_[insert trigger name here]. So if the name of your trigger was JASSTrigger, you would have your function be: function InitTrig_JASSTrigger takes nothing returns nothing It's important that you name it this way so that it gets called while the map is loading.

Now, if you've noticed, I've left out how to add a condition, oh my! Well, I'll show you how adding conditions work in triggers. Don't convert a GUI trigger to JASS to see how to do conditions, that way is inefficient. There's more code than you really need to use. Let me show you an example:
- Please include a note near end of lesson pointing out the InitTrig_[gui trigger name] being the first thing to check when encountering problems in this lesson.
- You don't have to include that much text about GUI trigger-conversion. It can actually be good sometimes when stuck, and if your point is that they leak then there's more challenges later on. :)
- Overall a good lesson even though I think there could be a slight cut down on noting various things I believe it sticks inside the current lesson topic well.

Sorry I quit doing this tut and found others :p

Last edited by bowzerbro : 01-19-2009 at 04:13 PM. Reason: Update
bowzerbro is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 08:41 AM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2014, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services