| 08-19-2004, 03:46 AM | #1 |
EDIT: WOW, Im learning a lot today, :D and its almost tomorrow! I learned how to use JASS! I learned about the new triggers in 1.17 that werent in the patch notes and I learned to use 'Edit Post' Thanks to weaddar! w00t!lol I was using an 'o' instead of '0' o_O sorry.Ok, now I still cannot write jass or read it very well but hey, I've found a use for it! I got this map and it require about 198 if then statments VERY simialr to each other, except for the item and the ability. So I know JASS uses weird codes for things such as A00E and stuff and I thought well wouldnt it be great if WE had a replace function, so I went up to edit and looked for, no luck. So basically Im wondering if Im looking in the wrong place or if there is a program that will add this feature to WE. Lastly when I did it by just using 'Find' and the CnP it didnt add work right :/ I'll post the code I have but I dont know if it'll help :** . Now, AO1H = Acid Bomb(my custom ver) and I029 = Acid Bomb ( the item). Code:
function Trig_Acid_Bomb_Test_JASS_Func003C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I029' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('AO1H', GetManipulatingUnit()) == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Acid_Bomb_Test_JASS_Func004C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I029' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('AO1H', GetManipulatingUnit()) == 1 ) ) then
return false
endif
return true
endfunction
function Trig_Acid_Bomb_Test_JASS_Func005C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I029' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('AO1H', GetManipulatingUnit()) == 2 ) ) then
return false
endif
return true
endfunction
function Trig_Acid_Bomb_Test_JASS_Actions takes nothing returns nothing
// Acid Bomb
if ( Trig_Acid_Bomb_Test_JASS_Func003C() ) then
call UnitAddAbilityBJ( 'AO1H', GetManipulatingUnit() )
return
else
call DoNothing( )
endif
if ( Trig_Acid_Bomb_Test_JASS_Func004C() ) then
call SetUnitAbilityLevelSwapped( 'AO1H', GetManipulatingUnit(), 2 )
return
else
call DoNothing( )
endif
if ( Trig_Acid_Bomb_Test_JASS_Func005C() ) then
call SetUnitAbilityLevelSwapped( 'AO1H', GetManipulatingUnit(), 3 )
return
else
call DoNothing( )
endif
endfunction
//===========================================================================
function InitTrig_Acid_Bomb_Test_JASS takes nothing returns nothing
set gg_trg_Acid_Bomb_Test_JASS = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Acid_Bomb_Test_JASS, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddAction( gg_trg_Acid_Bomb_Test_JASS, function Trig_Acid_Bomb_Test_JASS_Actions )
endfunction |
| 08-19-2004, 09:52 AM | #2 |
Why not just copy your jasscode into notepad and then use the replace function? |
| 08-19-2004, 03:38 PM | #3 |
heh, yeah, I also realized that last night... I need to thinkl b4 I post. Once school starts I will be in thinking mode again tho ^_^ |
