• 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.

Visionbug * item vision

Status
Not open for further replies.
Level 10
Joined
Feb 20, 2008
Messages
448
Ok actually all vision threads i see are all closed >.<

actually i got a vision bug on ONLY 1 CHAR

when he use revive ticket and revive his sight range is like 300, w/e IF U CHANGE NIGHT RANGE, IT DONT CHANGE ANYTHING, if i add cooldown on ticket between the time he click on ticket and that he rez its do nothings >.< is there a way to make a trigger that give 1500 range of sight and that following unit26 evrytime

or if its not possible is there a wc3 item that i could give it to him that could make him gain like 500 + of range anytime day/night

this shit pissing me off, i fixed all poeple vision bug xcept him >.< some1 plz help me im waiting this to release final version of my game >.<

and the 1 who bring me the idea ill give him credit in game as dbz tribute supreme if ya want >.< im rdy to make concession to get this bug fix
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
sure, there is the ability "Vision bonus", it has the icon of the goblin glasses.

There you can set the value "additional sight" to 500.

You only need this ability 2 times, one with + ! 500 and one with - ! 500 sight.

Then you just add them, when you want the unit to have +- 500 additional sight.

Greets
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
there maybe is an item, that uses this ability, but you'll have to create anyways two abilities.

So dont fear to use them, but you maybe want to create 2 items, and give one of them the + 500 ability and one of them the - 500 one.

The name of the ability is "goblin - nighvision" or something like that. Search it in the OE at Special - items
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
THIS is the way with triggers!

You just include the Action "Unit - Add Ability " in a trigger, maybe when the event "Unit acquires an item" becomes true.

If you want to reset the vision you just Remove the Ability "Unit - RemoveAbility".
 
Level 10
Joined
Feb 20, 2008
Messages
448
ok now i amde a trigger but it dont follow actually i use jass but i can use gui as well
JASS:
function Trig_Untitled_Trigger_003_Conditions takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetDyingUnit()) == 'E003' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Untitled_Trigger_003_Actions takes nothing returns nothing
    call TriggerSleepAction( 2 )
    call CreateNUnitsAtLoc( 1, 'h028', Player(1), GetUnitLoc(udg_unit26), bj_UNIT_FACING )
    call IssueTargetOrderBJ( GetLastCreatedUnit(), "move", udg_unit26 )
    call SetUnitTimeScalePercent( GetLastCreatedUnit(), 1000.00 )
    call SetUnitTurnSpeedBJ( GetLastCreatedUnit(), 1.00 )
    call SetUnitMoveSpeed( GetLastCreatedUnit(), 1000.00 )
    call SetUnitAcquireRangeBJ( udg_unit26, 1500.00 )
endfunction

is there a way to change getlastcreatedunit to the dummy effect ? so dummy effect folow dyng unit evrytime
 
Last edited:
That is not "jass", that is GUI converted text. =P

Use this:
JASS:
function Trig_Untitled_Trigger_003_Conditions takes nothing returns boolean
    return GetUnitTypeId(GetDyingUnit()) == 'E003' then
endfunction
    
function Trig_Untitled_Trigger_003_Actions takes nothing returns nothing
    local real x = GetUnitX(udg_unit26)
    local real y = GetUnitY(udg_unit26)
    local unit u
    call TriggerSleepAction(2)
    set u        = CreateUnit(Player(1),'h028',x,y,270)
    call IssueTargetOrder(u,"move",udg_unit26)
    call SetUnitTimeScale(u,10)
    call SetUnitTurnSpeed(u,1)
    call SetUnitMoveSpeed(u,1000)
    call SetUnitAcquireRange(udg_unit26,1500)
    set u = null
endfunction

If the function you posted works, then this should work.
 
Level 10
Joined
Feb 20, 2008
Messages
448
THIS is the way with triggers!

You just include the Action "Unit - Add Ability " in a trigger, maybe when the event "Unit acquires an item" becomes true.

If you want to reset the vision you just Remove the Ability "Unit - RemoveAbility".

well liek i said before i cant add any ability this is the kind of trigger that i want
JASS:
function Trig_veg_vision1_Actions takes nothing returns nothing
    call CreateNUnitsAtLoc( 1, 'h028', Player(1), GetUnitLoc(udg_unit26), bj_UNIT_FACING )
    call IssuePointOrderLocBJ( GetLastCreatedUnit(), "smart", GetUnitLoc(udg_unit26) )
    call SetUnitTimeScalePercent( GetLastCreatedUnit(), 1000.00 )
    call SetUnitTurnSpeedBJ( GetLastCreatedUnit(), ( 1 + 1 ) )
    call SetUnitMoveSpeed( GetLastCreatedUnit(), 1000.00 )
    call SetUnitAcquireRangeBJ( udg_unit26, 1500.00 )
    call KillUnit( GetLastCreatedUnit() )
    call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endfunction

//===========================================================================
function InitTrig_veg_vision1 takes nothing returns nothing
    set gg_trg_veg_vision1 = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_veg_vision1, 0.02 )
    call TriggerAddAction( gg_trg_veg_vision1, function Trig_veg_vision1_Actions )
endfunction


but i want to make only the unit that been created to move and get kiled etc, my map got 400 creep its might affect on, maybe some1 cant optimize it :/
 
Last edited:
Level 14
Joined
Jul 1, 2008
Messages
1,314
dude i thought, you wanted to modify vision bonusses?

Now you want to know, how to set variables, so please answer one question:

What are we talking about?

PurgeAndFire posted the "optimized code".

So where is the problem?-.-
 
Level 10
Joined
Feb 20, 2008
Messages
448
Thanks for you code i didnt see before!!! ill try it :p and u were right it was gui in jass, but i use gui converted to make jass with jass i already have :eek:

and i understand jass i can read them, but im not perfect :/

and now i understand whats was wrong :eek:!!! i cant explain but i know whast wrongs :p it will probly work ^^ but i got another kestion how poeple make reveal/hide things ? is there a place i can see, cuz i goty lot update in my map that could be nice to hide/reveal when we want :p thanks for all support and helps ^^

hiveworkshop own!!!

------------------------------
so i made this
JASS:
function Trig_veg_vision1_Actions takes nothing returns nothing
    local real x = GetUnitX(udg_unit26)
    local real y = GetUnitY(udg_unit26)
    local unit u
    call TriggerSleepAction(2)
    set u = CreateUnit(Player(1),'h028',x,y,270)
    call IssueTargetOrder(u,"move",udg_unit26)
    call SetUnitTimeScale(u,10)
    call SetUnitTurnSpeed(u,1)
    call SetUnitMoveSpeed(u,1000)
    call SetUnitAcquireRange(udg_unit26,1500)
    set u = null
endfunction

//===========================================================================
function InitTrig_veg_vision1 takes nothing returns nothing
    set gg_trg_veg_vision1 = CreateTrigger(  )
    call TriggerAddAction( gg_trg_veg_vision1, function Trig_veg_vision1_Actions )
endfunction
this is suposed to make a dummy effect andmake it follow unit 26 :p if it wrong tell me ill test it,....... ok i tested it and it dont work :/ i did something wrong , maybe i didnt explained correclty my english not so good!!! i need a jss or gui that create a dummy effect and make this dummy effect to alway be upper udg_unit 26 :/ i know this bug can happen cuz of revive trigger ill try making cooldown on these maybe it will work :/ but still i need find why it isnt working ..... i dont really understand jass variable so maybe u can help me more lol
 
Last edited:
Level 10
Joined
Feb 20, 2008
Messages
448
vision bug



this is what i made i wish i could make it better and more efficenci but actually it worked great, i made it twice with other i remove the 0.1 sec waiting, vision cant be lost as far i tested :p

its might help all other poeple that will need temporary vision for unit
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
this is dangerous, because you could overwrite "Last Created Visibly Modifier"

Also, Wait doesnt work with numbers <= 0.10 seconds!

So your code is bad!

try this:
JASS:
function Trig_Unbezeichneter_Ausl__ser_001_Actions takes nothing returns nothing
    local fogmodifier vision = CreateFogModifierRadius(Player(1), FOG_OF_WAR_VISIBLE,GetUnitX(udg_unit26),GetUnitY(udg_uni26),1500.00,true,false)
    call FogModifierStart(vision)
    call TriggerSleepAction(0.10)
    call DestroyFogModifier(vision)
    set vision = null
endfunction

//===========================================================================
function InitTrig_Unbezeichneter_Ausl__ser_001 takes nothing returns nothing
    set gg_trg_Unbezeichneter_Ausl__ser_001 = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_Unbezeichneter_Ausl__ser_001, 0.01 )
    call TriggerAddAction( gg_trg_Unbezeichneter_Ausl__ser_001, function Trig_Unbezeichneter_Ausl__ser_001_Actions )
endfunction

But as i already said, this is not a good choice, because you could make it so easy like this:
JASS:
function Trig_Unbezeichneter_Ausl__ser_001_Actions takes nothing returns nothing
    call UnitAddAbility(udg_unit26, 'xxxx') // Enter the name of your ability here
endfunction

//===========================================================================
function InitTrig_Unbezeichneter_Ausl__ser_001 takes nothing returns nothing
    set gg_trg_Unbezeichneter_Ausl__ser_001 = CreateTrigger(  )
    call TriggerRegisterPlayerChatEvent( gg_trg_Unbezeichneter_Ausl__ser_001, Player(0), "test", true ) // Player(0) writes "test"
    call TriggerAddAction( gg_trg_Unbezeichneter_Ausl__ser_001, function Trig_Unbezeichneter_Ausl__ser_001_Actions )
endfunction

Just create an ability, which gives vision bonus and enter its Id instead of xxxx.
You get the Id by pressing CTRL + D in the Object Editor.
 
Level 10
Joined
Feb 20, 2008
Messages
448
i understand but i cant add any ability to my hero thats why i need a trigger that create vision on unit or a trigger that create a dummy effect tht follow my unit automatic :/ your first trigger is more whats im looking for!!! but for yoru trigger if i read good:

this trigger create a vision on udg_unit26 but the trigger happening 0,01sec will it cause memory leak ? if not it wont make my game lag like last 1 i made :/ this bug pissing me off and happening to lot map maker!!!!! tehy should make a tutorial on vfixing vision bug via trigger!!!! if u know something bout memory leak plz help me to make it efficient liek anti-mh

edited

they had a error u miss a ''t'' on udg_unit26 well ill test it ill give back news later

and i had this trigger 2 that can be used if u make a dummy effect with vision, but i think mine dont work somehow
 
Last edited:
Level 14
Joined
Jul 1, 2008
Messages
1,314
I'm kind of speechless.

"My trigger " is your trigger dude, i think you only post to get +1 ?!

Well, i wont try to help you anymore, because i think there is no way to help, since you even didnt see, that i just posted your own trigger imporved!

And by the way, please improve your english, im not english, so im not perfect either, but i try to give my best - your text is just very hard to read!
 
Level 10
Joined
Feb 20, 2008
Messages
448
actually my game got alot of memoryleak so when i turn vision trigger on i got insanelag and i can barely do an item without making bug my objecteditor :/ best way would be remove memoryleak so vision trigger could work without anyshit like anti-maphack :/ im working on memoryleak now huge work i got like 600 trigger to optimze :/
 
Level 10
Joined
Feb 20, 2008
Messages
448
This Topic is Solved ^^

If any1 got a bug with vision on reviving this is out i set my revive trigger
i simply added a clock and cooldown on reviving!! thast e-z and make no lag!!

JASS:
function Trig_Good_Unit_dies_Actions takes nothing returns nothing
	if(Trig_Good_Unit_dies_Func002C())then
                call StartTimerBJ( udg_ctimer[1], false, 5.00 )
		call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetDyingUnit())),10.00,"|cffffcc00You will revive in 5 second")
                call TriggerSleepAction( 5.00 )
                call DestroyTimerDialogBJ( GetLastCreatedTimerDialogBJ() )
                call DestroyEffectBJ( GetLastCreatedEffectBJ() )
                call TriggerSleepAction(0.25)
		call ReviveHeroLoc(GetDyingUnit(),GetRectCenter(udg_rect89),false)
		set udg_unit18=GetDyingUnit()
		call TriggerExecute(udg_trigger612)
                call TriggerSleepAction(1.00)
		call UnitAddItemByIdSwapped('I02K',GetDyingUnit())
		call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetDyingUnit())),10.00,"|cffffcc00King Yama:|r Welcome to the other world. Since you have done good deeds in your life I will allow you to return to Earth, that is, if I still have some tickets left. If not then I guess you'll have to remain here, behind me is Snake Way, if you reach the end of it, you can be trained by King Kai.")
                set udg_ctimer[1] = null
	else
		call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetDyingUnit())),10.00,"|cffffcc00You will revive in 20 second")
                call StartTimerBJ( udg_ctimer[2], false, 20.00 )
                call TriggerSleepAction( 20.00 )
                call DestroyEffectBJ( GetLastCreatedEffectBJ() )
                call TriggerSleepAction(0.25)
		call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetDyingUnit())),10.00,"|cffffcc00King Yama:|r Oh dear. You just died, when your already dead! It's gonna take me some time to return you to this dimension...")
		call ReviveHeroLoc(GetDyingUnit(),GetRectCenter(udg_rect89),false)
		call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetDyingUnit())),10.00,"|cffffcc00King Yama:|r Welcome back to the other world. Try not to die again this time!!!")
                set udg_ctimer[2] = null
	endif
endfunction
 
Last edited:
Status
Not open for further replies.
Top