• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Complicated Texture Switcher

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Greetings My name is Ender, let me introduce you to my Complicated Texture Switcher(CTS)
it is a system that(provided you do a simple model edit) allows units to change their textures, it does this using complicated methods(ie war club ability, that has been set so that it enabls and disable attack 3(ie neither) and has 0 hits(theoretically infinity as i believe they use hitsleft = hitsleft- 1 ; if hitsleft == 0 ;stop warclub;)
anyway here is my
JASS:
function Trig_UnitStart_Actions takes nothing returns nothing
    local destructable d = CreateDestructable(udg_CUT_Default_Destructable, GetUnitX(udg_UDexUnits[udg_UDex]) + 32*Cos(GetUnitFacing(udg_UDexUnits[udg_UDex])*bj_DEGTORAD), GetUnitY(udg_UDexUnits[udg_UDex])+32*Sin(GetUnitFacing(udg_UDexUnits[udg_UDex])*bj_DEGTORAD),0,0.1,1)

    call UnitAddAbility(udg_UDexUnits[udg_UDex],udg_CUT_Ability)
    call IssueTargetDestructableOrder( udg_UDexUnits[udg_UDex], "grabtree", d )
    call UnitRemoveAbility(udg_UDexUnits[udg_UDex],udg_CUT_Ability)

    call TriggerSleepAction( 0.10 )
    call RemoveDestructable(d)
    set d = null
endfunction

//===========================================================================
function InitTrig_UnitStart takes nothing returns nothing
    set gg_trg_UnitStart = CreateTrigger(  )
    call TriggerRegisterVariableEvent( gg_trg_UnitStart, "udg_UnitIndexEvent", EQUAL, 1.00 )
    call TriggerAddAction( gg_trg_UnitStart, function Trig_UnitStart_Actions )
endfunction
JASS:
function Trig_ChangeUnitTexture_Actions takes nothing returns nothing
    local destructable d  = CreateDestructable(udg_CUT_WhatTexture, GetUnitX(udg_CUT_Unit) + 32*Cos(GetUnitFacing(udg_CUT_Unit)*bj_DEGTORAD), GetUnitY(udg_CUT_Unit)+32*Sin(GetUnitFacing(udg_CUT_Unit)*bj_DEGTORAD),0,0.1,1)

    call UnitAddAbility(udg_CUT_Unit, udg_CUT_Ability)
    call IssueTargetDestructableOrder( udg_CUT_Unit, "grabtree", d )
    call UnitRemoveAbility(udg_CUT_Unit,udg_CUT_Ability)

    call TriggerSleepAction( 0.10 )
    call RemoveDestructable(d)
    set d = null
endfunction

//===========================================================================
function InitTrig_ChangeUnitTexture takes nothing returns nothing
    set gg_trg_ChangeUnitTexture = CreateTrigger(  )
    call TriggerRegisterVariableEvent( gg_trg_ChangeUnitTexture, "udg_ChangeUTexture", EQUAL, 1.00 )
    call TriggerAddAction( gg_trg_ChangeUnitTexture, function Trig_ChangeUnitTexture_Actions )
endfunction

1: Get Magos's Model Editor(if you don't have it already) you can find it at http://www.hiveworkshop.com/forums/tools.php?id=s5yian

2:Open up the model you want to use: File>Open

3:Open up Texture Manager: Window>Texture Manager

4: Right click and then select, create empty Texture

5:Right click the new texture go to edit and set the replacable id to 31.

6: Go to Material Manager : Window>Material Manager

7: Go through the materials you want to modify and

8:Add a new material Layer on top and then edit it

9: set its texture to the texture you created earlier, THEN set the filter Mode to TRANPSPERENCY

10:Import it into your map, if you don't know how to do this, there is a tutorial somewhere in the tutorial section


I have blatantly disregarded one of the spells sections rules, ie no imports i am unrepentant for this, i imported exactly 2 things, one of which was necessary the other more aesthetically pleasing then a tree I hope you don't mind,
also i have tested this system to make sure that units will not lose their texture, i cannot guarantee that they will not, iIcan just guarantee that it lasts more then 84,000 hits(100 hits per second for 14 minutes) this isn't a very complicated system, despite its title, but 1 there are no systems that do this, 2 this could be really useful, and 3 this is new


Credits to Bribe for Unit indexer, which i use to set units texture, whenever a unit is indexed, to the default texture, IE ALPHA
Credits to Magos for warcraft 3 model editor which i used to modify the footman model to make so that it can use this system

(to those who don't understand, i was trying to be funny when i said it was complicated)

Keywords:
Awesome, texture, change, unit,one and only,ender,wiggin, xeonocide,multiple
Contents

Complicated Texture Switcher (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. 07:28, 4th Sep 2012 Magtheridon96: This should be a tutorial because it's not much of a usable plug-and-play system :/ Still, great job ^_^ I like the method. It stops people from...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.

07:28, 4th Sep 2012
Magtheridon96: This should be a tutorial because it's not much of a usable plug-and-play system :/

Still, great job ^_^
I like the method.
It stops people from having to create and remove units thus losing all data attached to handle ids or unit indexer custom values.
 
Top