• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

how can i limit where units can change into other units

Status
Not open for further replies.
Level 21
Joined
Mar 2, 2010
Messages
3,069
vjass require a third party program. i want to keep my game legal so that i can use it on battle.net. therefore only the jass supported by the editor will do. i need a script that that makes units able to only change into other units in certain areas.(like around buildings.)
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
vJass is converted to Jass upon saving the map (I think that's when? It happens at some point, regardless). It's essentially undetectable. The parts that would be detectable are the broken limits. But Blizz don't give a crap about wc3 anymore.
 
Level 21
Joined
Mar 2, 2010
Messages
3,069
i prefer to play by the rules. therefore i want to avoid vjass. i have had enough problems with blizzard as it is.(they once suspended my battle.net account because my email had been hacked.) please help me create script that limits where units can transform into other units that doesnt involve vjass.
 
Last edited:
Level 12
Joined
Jan 30, 2009
Messages
1,067
If you found insult in my statement, it is completely on your side, as there was none intended.
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
Unfortunately, I do not use anything but GUI. So I cannot help you. So after my initial input was shot down, I wished you luck for a reason. Cause I can't help. And tbh, probably not many use regular jass these days, from what I can tell.

Anyway, on a side-note, I love your avatar. It's adorable. :)
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
Unfortunately, I"m also not a good candidate for that.

I bug Maker, Pharoh_, and Adiktuz for my triggers constantly, lol.

And bug Defskull for spells. ^^

I simply use GUI via logic and lots of trial and error. And when that fails, I come here and bug someone who knows, :p
 
Level 5
Joined
Oct 14, 2010
Messages
100
Actually, you can detect if vjass was used. A map with vjass has 2 scripts: 1 in vjass (used by World Edit, ignored by Warcraft 3), 1 in jass (used by wc3, ignored by world edit). Even if you remove the one in vjass (which requires a 3rd party program, breaking the EULA), your jass script will still have vjass comments (e.g. jasshelper will add a // begin library lib when it encounters library lib) and specific headings (private functions have lib__ in front of the function). Removing those would be a LOT of work (possibly more than just using jass) unless you use a script obfuscator tool, which also breaks the EULA and in turn is also detectable.

But to stay on-topic: I don't really know what you want. Do you want an ability to be canceled when it's not cast in a specific region?

'A000' is the Raw ID of your ability
"Region" is a region variable (in the variable editor)
JASS:
// Quickly copied this function from a post by Doomhammer on thehelper. Don't know if it works, but it probably does.
function IsUnitInRect takes unit u, rect r returns boolean
    return (GetUnitX(u) > GetRectMinX(r)-32 and GetUnitX(u) < GetRectMaxX(r)+32) and (GetUnitY(u) > GetRectMinY(r)-32 and GetUnitY(u) < GetRectMaxY(r)+32)
endfunction

function Trig_Spell_Actions takes nothing returns nothing   
    if (GetSpellAbilityId() == 'A000') then // If the ability being cast is your custom ability, then continue
        if (not IsUnitInRect(GetTriggerUnit(), udg_Region)) then // If the unit is not in the specified region, then continue
            call IssueImmediateOrder(GetTriggerUnit(), "stop") // Order the unit to stop
        endif
    endif
endfunction

//===========================================================================
function InitTrig_Spell takes nothing returns nothing
    set gg_trg_Spell = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Spell, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddAction( gg_trg_Spell, function Trig_Spell_Actions )
endfunction
 
Level 21
Joined
Mar 2, 2010
Messages
3,069
in the project i am working on, units transform into other units. i cant however find out how to limit that transformation to the proximity of buildings. i also want to create a sub menu for transformations. i cant however use vjass because blizzard specifically stated that they are against it. (they even threatened me.) the only way i can use vjass is if blizzard gives me permission.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
You can use this trigger to "transform" the unit?
  • Unit - Replace (Triggering unit) with a Footman using The new unit's max life and mana
It replaces/transforms the unit to a new unit

EDIT:
i want units to only be able to transform into other units near buildings.
Tell me, does this "transform privilege" is based on SPELLS/ABILITIES, right ?
Not on "Player Chat Message", maybe type -Transform or anything ?
I can make a spell that enable/disable the transform ability when near/far from a building
 
Level 21
Joined
Mar 2, 2010
Messages
3,069
the basal golem transforms into all other units near buildings, while other units transform into basal golems near the blood forge. the basal golem transforms to paladins near the barracks or the temple. they transform into wizards and stone golems near rune stones. they transform into gargoyles, ghouls and wraiths near crypts. they transform into druids and griffins near arbor lodges. they transform into clerics near temples. (that is how it works in the real blood and magic.) that is how i want it in my map.
 
Level 21
Joined
Mar 2, 2010
Messages
3,069
i have come closer to a solution. though i need jass for the event trigger because the trigger editor doesnt have support for that. i need an event that triggers when a unit comes within range of a certain building. (close enough to attack it in melee.) it also need to only trigger around own buildings.
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
Unit Enters Region event. Place the Regions on top of the buildings. It's a lot of work, but it should work fine.
 
Status
Not open for further replies.
Top