polar projection for my td (newbie needs help)

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
I use custom script in GUI. I scare you dunno Jass, so I din convert it.
 

killingdyl

Active Member
Reaction score
6
i cant open it for some reason... can u post the triggers so i can see it and maybe i can make the trigger myself
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Create a trigger named "SAS" and copy script's below into it.

JASS:

///////////////////////////////////////////////////////////////////////////////////////////
//This is a simple attach system, it's function is limited.
//
//Can only attach unit to unit.
//
//It is enough for your request.
//////////////////////////////////////////////////////////////////////////////////////////

library SAS

globals
    private constant integer HASH_DOWN = 524288
    private constant integer HASH_UP = 2134900736
    private constant integer HASH_BIAS = 4096
    //This sytem use Hash to calculate the integer after converting handles.
endglobals

private function H2I takes handle h returns integer//H2I is a common function use in converting handle into integer
    return h
    return 0
endfunction

private function H2U takes handle h returns unit
    return h
    return null
endfunction

/////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////Storing Engine////////////////////////////////////////////
private struct StoredUnit

    unit u
    
        static method StoreUnitz takes unit attached returns StoredUnit
            local StoredUnit Index = StoredUnit.allocate()
            set Index.u = attached
            return Index
        endmethod
        
        method GetUnit takes nothing returns unit
            return .u
        endmethod
        
        method onDestroy takes nothing returns nothing
            set .u = null
        endmethod
endstruct
///////////////////////////////////////////////////////////////////////////////////////////

//! textmacro SAS takes number
globals
    private integer array Sandbox$number$//We use text macroes to create multi instanceable system.
endglobals

////////////////////////////Attach Unit to tower///////////
function SetUnitToTower$number$ takes unit attacher, unit attached returns nothing
    local StoredUnit S = StoredUnit.StoreUnitz(attached)
    set Sandbox$number$[(H2I(attacher)*HASH_UP)/HASH_DOWN+HASH_BIAS] = S
endfunction
//////////////////////////////////////////////////////////


////////////////////////////Get Unit From Tower/////////////
function GetAttachedUnit$number$ takes unit attacher returns unit
    local StoredUnit S = Sandbox$number$[(H2I(attacher)*HASH_UP)/HASH_DOWN+HASH_BIAS]
    return S.GetUnit()
endfunction
////////////////////////////////////////////////////////////

////////////////////////////Clear Attached Units//////////
function ClearAttachedUnit$number$ takes unit attacher returns nothing
    local StoredUnit S = Sandbox$number$[(H2I(attacher)*HASH_UP)/HASH_DOWN+HASH_BIAS]
    call S.destroy()
endfunction
//////////////////////////////////////////////////////////


//! endtextmacro
//! runtextmacro SAS("A")
//! runtextmacro SAS("B")
//! runtextmacro SAS("C")
//! runtextmacro SAS("D")
//! runtextmacro SAS("E")

endlibrary
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
At your 2 child trigger, add and change some stuffs :

Trigger:
  • Events
    • A units finishes an upgrade
    • Conditions
    • unit type = 2 child
    • Actions
    • Custom script : local unit u
    • Custom script : local unit tower = GetTriggerUnit()
    • Unit - Create Child......
    • Custom script : set u = GetLastCreatedUnit()
    • Custom script : call SetUnitToTowerA(tower,u)
    • Unit - Create Child......
    • Custom script : set u = GetLastCreatedUnit()
    • Custom script : call SetUnitToTowerB(tower,u)
    • set u = null
    • set tower = null
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Add some stuffs too at the most below of your Sell trigger

Trigger:
  • Actions
    • bla bla bla...
    • If Unit-type of Triggering Unit equal to 2 child
    • Then
    • Unit-Remove Unit(GetAttachedUnitA(GetTriggerUnit())
    • Unit-Remove Unit(GetAttachedUnitB(GetTriggerUnit())
    • Custom script : call ClearAttachedUnitA(GetTriggerUnit())
    • Custom script : call ClearAttachedUnitB(GetTriggerUnit())
 

killingdyl

Active Member
Reaction score
6
for the upgrade trigger can u tell me what kind of variable is "u" and "tower"?
And thanks for the help

Edit: also i think the reason i couldnt open it is that the part
Trigger:
  • Unit-Remove Unit(GetAttachedUnitA(GetTriggerUnit())
    • Unit-Remove Unit(GetAttachedUnitB(GetTriggerUnit())


is a custom trigger that i dont have. so can u walk me through how to create custom GUIs?
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
If you had Jass NewGen Pack, it is easy to create it by selecting the "Jass script" at the most below.

Sorry, it is
Trigger:
  • Unit - Remove(GetAttachedUnitA())from game
    • Unit - Remove(GetAttachedUnitB())from game


u is the child, tower is the tower.
They r locals. It is a basic MUI but it cun pass through others place, unlike globals.

Example :
JASS:
function SetUnitToTowerA takes unit tower, unit child returns nothing
endfunction


Above this is the actually actions I created.

JASS:
call SetUnitToTowerB(tower,u)


Then above this is attach second child to the tower.

To create custom GUI, you need to learn Jass.

Jass is faster than GUI and risk to lag is least. I had learn it from : http://www.hiveworkshop.com/forums/f280/beginning-jass-tutorial-series-30765/

Understanding other's map script is also an improvement in making a good map. You can see how they use the functions, their coding style and much more stuffs.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
select a trigger, click options, click convert to custom text. Then you will see the jass.:)
 

killingdyl

Active Member
Reaction score
6
i mean the 2 child trigger and the jass for removing the unit. because i cant insert the GetAttachedUnitA() and B part as a gui. and i cant set local variables with gui so i cant set u and tower
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
This is the remove unit in Jass :
JASS:

function RemoveUnit takes unit returns nothing
endfunction


We can use it by using :
JASS:

call RemoveUnit(unit u want to remove)


============================================
Variables can divided into 2 types :
globals
locals

globals can be changed at anywhere, but locals can't.
Globals is not MUI, but locals are.

How to declare/create a new locals?? See below :
JASS:

local <variable> <variable's name>


Example(We create a unit locals variable with it's name is hello) :
JASS:

local unit hello


How to set value to it?
JASS:

set hello = <Unit you want to set>


Happy Jassing!!:p
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
To make use of them and instead converting whole trigger into Jass view, Use custom script at the new action dialog.:)
 

killingdyl

Active Member
Reaction score
6
i cant find the
Trigger:
  • Unit - Remove(GetAttachedUnitA())from game
    • Unit - Remove(GetAttachedUnitB())from game


part in gui
can you help me there?
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
use this

Trigger:
  • Custom script : call RemoveUnit(GetAttachedUnitA())

Trigger:
  • Custom script : call RemoveUnit(GetAttachedUnitB())
 

killingdyl

Active Member
Reaction score
6
hey i did everything perfectly with the trigger but it still wont create the 2 childs. HELP

Trigger:
  • Two Child
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to |cFF00FFFF2 Childs|r
    • Actions
      • Custom script: local unit u
      • Custom script: local unit tower = GetTriggerUnit()
      • Unit - Create 1 Dummy Child for (Owner of (Constructed structure)) at ((Position of (Constructed structure)) offset by 32.00 towards 0.00 degrees) facing Default building facing degrees
      • Custom script: set u = GetLastCreatedUnit()
      • Custom script: call SetUnitToTowerA(tower,u)
      • Unit - Create 1 Dummy Child for (Owner of (Constructed structure)) at ((Position of (Constructed structure)) offset by 32.00 towards 180.00 degrees) facing Default building facing degrees
      • Custom script: set u = GetLastCreatedUnit()
      • Custom script: call SetUnitToTowerB(tower,u)
      • Custom script: set u = null
      • Custom script: set tower = null
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
hey i did everything perfectly with the trigger but it still wont create the 2 childs. HELP

Trigger:
  • Two Child
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to |cFF00FFFF2 Childs|r
    • Actions
      • Custom script: local unit u
      • Custom script: local unit tower = GetTriggerUnit()
      • Unit - Create 1 Dummy Child for (Owner of (<b>Constructed structure</b>)) at ((Position of (Constructed structure)) offset by 32.00 towards 0.00 degrees) facing Default building facing degrees
      • Custom script: set u = GetLastCreatedUnit()
      • Custom script: call SetUnitToTowerA(tower,u)
      • Unit - Create 1 Dummy Child for (Owner of (<b>Constructed structure</b>)) at ((Position of (Constructed structure)) offset by 32.00 towards 180.00 degrees) facing Default building facing degrees
      • Custom script: set u = GetLastCreatedUnit()
      • Custom script: call SetUnitToTowerB(tower,u)
      • Custom script: set u = null
      • Custom script: set tower = null

use this :
Change all ur Constructed Structure to Triggering Unit
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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!
    +1
  • 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
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top