JASS 101 Classroom

Status
Not open for further replies.
I

IKilledKEnny

Guest
Rodead, next time please send next time assignments to me by Private Massaging. Also the second part of the assignment requests that you add at least 5 comments around the trigger.
 

Hero

─║╣ero─
Reaction score
250
this is my homework i atacked it in a map here is the code

Code:
function Trig_create_unit_Conditions takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'hfoo' ) ) then
        return false
    endif
    return true
endfunction

function Trig_create_unit_Actions takes nothing returns nothing
    call CreateNUnitsAtLocFacingLocBJ( 1, 'hfoo', Player(0), GetRectCenter(GetPlayableMapRect()), GetUnitLoc(GetDyingUnit()) )
endfunction

//===========================================================================
function InitTrig_create_unit takes nothing returns nothing
    set gg_trg_create_unit = CreateTrigger(  )
    call TriggerRegisterPlayerUnitEventSimple( gg_trg_create_unit, Player(0), EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_create_unit, Condition( function Trig_create_unit_Conditions ) )
    call TriggerAddAction( gg_trg_create_unit, function Trig_create_unit_Actions )
endfunction


Lol...I told you to clean it up...I even showed you how..learn from it even if you didn't optimize it you can still learn from it


__________________



IKilledKEnny I'll take a nice look at this thread every now and then to see how your doing..also willing to check homework :D
 

elmstfreddie

The Finglonger
Reaction score
203
Oops... Forgot to make it have the condition of that the triggering unit is a footman. Smart. Hold on...
Code:
function Trig_Untitled_Trigger_001_Conditions takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'hfoo' ) ) then
        return false
    endif
    return true//Ok that all seemed retarded, can't you just remove the "not" and then have return true for the then...?
endfunction

function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    call CreateNUnitsAtLoc( 1, 'hfoo', Player(0), GetRectCenter(GetPlayableMapRect()), bj_UNIT_FACING )//creates a footman (hfoo) at centre of playable map area (get rect centre etc) facing the bj facing (default building facing)
endfunction//ends the function, lol

//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_001 = CreateTrigger(  )//Eh eh eh? This doesn't seem necessary =/
    call TriggerRegisterPlayerUnitEventSimple( gg_trg_Untitled_Trigger_001, Player(0), EVENT_PLAYER_UNIT_DEATH )//Runs the trig if a unit owned by player 1 (or player 0 in JASS) dies
    call TriggerAddCondition( gg_trg_Untitled_Trigger_001, Condition( function Trig_Untitled_Trigger_001_Conditions ) )//Makes it check the condition I believe =/
    call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction
There, my ugly long comments. If I do write down comments on my JASS, there will probably be tonnes and they will be 3 miles long lol
 

Slywolf15

Member
Reaction score
5
Oops... Forgot to make it have the condition of that the triggering unit is a footman. Smart. Hold on...
Code:
function Trig_Untitled_Trigger_001_Conditions takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'hfoo' ) ) then
        return false
    endif
    return true//Ok that all seemed retarded, can't you just remove the "not" and then have return true for the then...?
endfunction

function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    call CreateNUnitsAtLoc( 1, 'hfoo', Player(0), GetRectCenter(GetPlayableMapRect()), bj_UNIT_FACING )//creates a footman (hfoo) at centre of playable map area (get rect centre etc) facing the bj facing (default building facing)
endfunction//ends the function, lol

//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_001 = CreateTrigger(  )//Eh eh eh? This doesn't seem necessary =/
    call TriggerRegisterPlayerUnitEventSimple( gg_trg_Untitled_Trigger_001, Player(0), EVENT_PLAYER_UNIT_DEATH )//Runs the trig if a unit owned by player 1 (or player 0 in JASS) dies
    call TriggerAddCondition( gg_trg_Untitled_Trigger_001, Condition( function Trig_Untitled_Trigger_001_Conditions ) )//Makes it check the condition I believe =/
    call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction
There, my ugly long comments. If I do write down comments on my JASS, there will probably be tonnes and they will be 3 miles long lol


I'm quite sure he said you needed to pm your homework. Probably to keep people from copying.
 

Hero

─║╣ero─
Reaction score
250
Optimize it

Code:
function Trig_create_unit_Conditions takes nothing returns boolean
    return GetUnitTypeId(GetTriggerUnit()) == 'hfoo' 
endfunction

function Trig_create_unit_Actions takes nothing returns nothing
    call CreateUnitAtLoc(Player(0),'hfoo',GetRectCenter(GetPlayableMapRect()),0)
endfunction

//===========================================================================
function InitTrig_create_unit takes nothing returns nothing
    set gg_trg_create_unit = CreateTrigger(  )
    call TriggerRegisterPlayerUnitEventSimple( gg_trg_create_unit, Player(0), EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_create_unit, Condition( function Trig_create_unit_Conditions ) )
    call TriggerAddAction( gg_trg_create_unit, function Trig_create_unit_Actions )
endfunction

yes it leaks...but I don't think they learned about that yet
 

pheonixashes

Those who misplace trust in gods learn their fate.
Reaction score
65
I'm not in the class, KEnny, but I think it would be useful to put a link or an attachment on the first page, for easy reading.

Just a thought. ^_^.

EDIT: Oh nvm you already have it.
 

Hero

─║╣ero─
Reaction score
250
I wonder where IKilledKEnny is at...hmhmh...maybe I should help him with this thread..lol

________
I'll be the substitute teacher for now...go ahead post questions and what not..lol
 

Hero

─║╣ero─
Reaction score
250
---Removed The Script for Copying Reasons----


Looks good for what knowledge you should know..I can't wait until you all become JASS scripters...it's like watching a child grow up :D
 

Hero

─║╣ero─
Reaction score
250
Just edit them and write something like

Removed The Script

I'll do it in my post too
 
I

IKilledKEnny

Guest
Thanks for fixing it hero12341234 but we are no there yet. :) If an admin could clean the posts from this one to Rodead's that would be great, I want to prevent copying and confusion.

I have gotten few assignment already, however not everyone sent them, remember, you have until Friday if you want to get a grade!
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
Wait, we just have to convert a GUI trigger into JASS and then comment the action(Not actionS) for the assignment?
 
I

IKilledKEnny

Guest
And add a few comments. Also you get extra grade if you say what each line do.

Sorry to disappoint you Andrewgosu, but all I taught until now is what is JASS and how to work with it.
 

Omni

Ultra Cool Member
Reaction score
37
>you have until Friday if you want to get a grade!
My stupidity will get rated OH NO!
;)
 

Knocksious

Sweet, I got 2 little green bars!
Reaction score
46
hey, is there a JASS editor that works on a mac? Or do I have to install virtual PC...

I could work directly on WE, but he said that wasn't a good option
 
Status
Not open for further replies.
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top