Well, here is a HSS I made for my Single Player RPG.
It isn't very funny on the screenshot, so I recommend you to check it out :)
MUI: Should it? :P
vJASS: Couldn't live without..
JASS/GUI: I think it's GUI... :)
Systems used: None! (Only a texttag library, not anything fancy)
Code:
JASS:
libraryHSSrequiresTextTag// Configurable globalsglobalsprivateconstantrealInterval = 0.01// The timer interval.privateconstantrealTurn = 5// The real the current hero is turned every Interval seconds.privateconstantrectChooseRect = gg_rct_Hero_Selection// The region where the hero selection takes place.privateconstantrectCreateRect = gg_rct_Hero_Selection// The region where the hero is created.privateconstantintegerRows = 10// The number of rows in the multiboard.// I'm sorry, but you can't edit the columns. :(privateconstantrealHeroWidth = 16// The width of the hero name spot.privateconstantrealDescWidth = 60// The width of the hero description spot.privateconstantstringTitle = "Hero Selection"// The title of the multiboard.constantrealHeight = 10// The height of floating text.constantintegerPlayerID = 0// The player you want this to work for. (Remember, in JASS the players are minus one, eg.: Player 0 == Player 1, Player 2 == Player 3 etc.)privateconstantstringCreateFX = "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl"// The creation fx.privateconstantstringAttach = "origin"// Where CreateFX is attached to the unit.endglobals// Necessary globalsglobalsunitcurrentrealHSSXrealHSSYrealCHSSXrealCHSSYrealfacingintegerarrayidstringarraynamestringarraydescstringarrayfdescintegersizeintegerCSintegermaxtexttagTextprivatetriggerT0privatetriggerT1privatetriggerT2privatetriggerT3privatetriggerT4// Multiboard stuff...privatemultiboardMultiboardprivatemultiboarditemHeroTextprivatemultiboarditemDescTextendglobalsprivatefunctionTurnActstakesnothingreturnsnothingsetfacing=GetUnitFacing(current)+TurncallSetUnitFacing(current,facing)
callPanCameraTo(HSSX,HSSY)
endfunctionprivatefunctionPicktakesnothingreturnsnothinglocalintegerid=GetUnitTypeId(current)
localunitdcallRemoveUnit(current)
callPanCameraTo(CHSSX,CHSSY)
setd=CreateUnit(Player(PlayerID),id,CHSSX,CHSSY,facing)
callSelectUnit(d,true)
callDestroyEffect(AddSpecialEffectTarget(CreateFX,d,Attach))
// And now, leak cleaning;callDestroyTrigger(T0)
callDestroyTrigger(T1)
callDestroyTrigger(T2)
callDestroyTrigger(T3)
callDestroyTrigger(T4)
callDestroyTextTag(Text)
callDestroyMultiboard(Multiboard)
setT0=nullsetT1=nullsetT2=nullsetT3=nullsetT4=nullsetText=nullsetMultiboard=nullsetHeroText=nullsetDescText=null// And last, but not least, our love;setcurrent=nullsetd=nullendfunctionprivatefunctionDowntakesnothingreturnsnothingifCS!=0thensetCS=CS-1callMultiboardSetItemValue(HeroText,name[CS])
callMultiboardSetItemValue(DescText,desc[CS])
callRemoveUnit(current)
callDestroyTextTag(Text)
setText=FadingTextSingle(Player(PlayerID),fdesc[CS],255,255,255,HSSX,HSSY,0,9999999,9999999)
setcurrent=CreateUnit(Player(PlayerID),id[CS],HSSX,HSSY,facing)
callSetCameraTargetController(current,0,0,true)
callPanCameraTo(HSSX,HSSY)
callUnitAddAbility(current,'Aloc')
callPauseUnit(current,true)
endifendfunctionprivatefunctionUptakesnothingreturnsnothingifCS!=(max-1) thensetCS=CS+1callMultiboardSetItemValue(HeroText,name[CS])
callMultiboardSetItemValue(DescText,desc[CS])
callRemoveUnit(current)
callDestroyTextTag(Text)
setText=FadingTextSingle(Player(PlayerID),fdesc[CS],255,255,255,HSSX,HSSY,0,9999999,9999999)
setcurrent=CreateUnit(Player(PlayerID),id[CS],HSSX,HSSY,facing)
callSetCameraTargetController(current,0,0,true)
callPanCameraTo(HSSX,HSSY)
callUnitAddAbility(current,'Aloc')
callPauseUnit(current,true)
endifendfunctionprivatefunctionSetuptakesnothingreturnsnothinglocalintegeri=0setMultiboard=CreateMultiboard()
callMultiboardSetColumnCount(Multiboard,5)
callMultiboardSetRowCount(Multiboard,Rows)
callMultiboardSetTitleText(Multiboard,Title)
setHeroText=MultiboardGetItem(Multiboard,1,0)
setDescText=MultiboardGetItem(Multiboard,4,0)
callMultiboardSetItemWidth(HeroText,HeroWidth)
callMultiboardSetItemWidth(DescText,DescWidth)
loopexitwheni>RowscallMultiboardSetItemStyle(MultiboardGetItem(Multiboard,i,0),true,false)
callMultiboardSetItemStyle(MultiboardGetItem(Multiboard,i,1),true,false)
callMultiboardSetItemStyle(MultiboardGetItem(Multiboard,i,2),true,false)
callMultiboardSetItemStyle(MultiboardGetItem(Multiboard,i,3),true,false)
callMultiboardSetItemStyle(MultiboardGetItem(Multiboard,i,4),true,false)
callMultiboardSetItemStyle(MultiboardGetItem(Multiboard,i,5),true,false)
seti=i+1endloopseti=0callMultiboardSetItemValue(HeroText,name[0])
callMultiboardSetItemValue(DescText,desc[0])
callMultiboardDisplay(Multiboard,true)
endfunctionfunctionAddHerotakesintegerID, stringNAME, stringDESCRIPTION, stringFLOATDESC, booleanSETCURRreturnsunitsetid[size]=IDsetname[size]=NAMEsetdesc[size]=DESCRIPTIONsetfdesc[size]=FLOATDESCifSETCURR==truethenifcurrent!=nullthencallRemoveUnit(current)
endifsetcurrent=CreateUnit(Player(PlayerID),id[size],HSSX,HSSY,0)
callSetCameraTargetController(current,0,0,true)
callPanCameraTo(HSSX,HSSY)
callUnitAddAbility(current,'Aloc')
callPauseUnit(current,true)
setText=FadingTextSingle(Player(PlayerID),FLOATDESC,255,255,255,HSSX,HSSY,0,9999999,9999999)
endifsetsize=size+1setmax=max+1returncurrentendfunction//===========================================================================functionInitTrig_HeroSelectionSystemtakesnothingreturnsnothingsetT0=CreateTrigger()
setT1=CreateTrigger()
setT2=CreateTrigger()
setT3=CreateTrigger()
setT4=CreateTrigger()
callTriggerRegisterTimerEvent(T1,Interval,true)
callTriggerAddAction(T1,functionTurnActs)
setHSSX=GetRectCenterX(ChooseRect)
setHSSY=GetRectCenterY(ChooseRect)
setCHSSX=GetRectCenterX(CreateRect)
setCHSSY=GetRectCenterY(CreateRect)
callCreateFogModifierRect(Player(0),FOG_OF_WAR_VISIBLE,ChooseRect,false,false)
setsize=0setCS=0setmax=0setcurrent=nullcallTriggerRegisterTimerEvent(T0,0,false)
callTriggerAddAction(T0,functionSetup)
callTriggerRegisterPlayerKeyEventBJ(T2,Player(0),bj_KEYEVENTTYPE_DEPRESS,bj_KEYEVENTKEY_DOWN)
callTriggerAddAction(T2,functionDown)
callTriggerRegisterPlayerKeyEventBJ(T3,Player(0),bj_KEYEVENTTYPE_DEPRESS,bj_KEYEVENTKEY_UP)
callTriggerAddAction(T3,functionUp)
callTriggerRegisterPlayerEventEndCinematic(T4,Player(0))
callTriggerAddAction(T4,functionPick)
endfunctionendlibrary
As this works only in SP, this is definitely not a system. If you update it to make it work for all players, then this could be acceptable, but until then no. This could be a sample if you don't want to make it for all players.
Following the new rules, if you don't update or respond to this thread within 7 days, this will be graveyarded.
As this works only in SP, this is definitely not a system. If you update it to make it work for all players, then this could be acceptable, but until then no. This could be a sample if you don't want to make it for all players.
Following the new rules, if you don't update or respond to this thread within 7 days, this will be graveyarded.