• 🏆 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!

Need help

Status
Not open for further replies.
Level 8
Joined
Jun 13, 2012
Messages
336
Hey guys my map keeps crashing when it starts.
  • First roll
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Endings[0] = Tutorial
      • Set Endings[1] = HumanB
      • Set Endings[2] = HumandE
      • Set Endings[3] = Undead
      • Set Endings[4] = Orc
      • Set Endings[5] = Night Elf
      • Set Endings[6] = ExpB
      • Set Endings[6] = ExpE
      • Custom script: set udg_Campaign[0] = bj_CAMPAIGN_INDEX_T
      • Custom script: set udg_Campaign[1] = bj_CAMPAIGN_INDEX_H
      • Custom script: set udg_Campaign[2] = bj_CAMPAIGN_INDEX_H
      • Custom script: set udg_Campaign[3] = bj_CAMPAIGN_INDEX_U
      • Custom script: set udg_Campaign[4] = bj_CAMPAIGN_INDEX_O
      • Custom script: set udg_Campaign[5] = bj_CAMPAIGN_INDEX_N
      • Custom script: set udg_Campaign[6] = bj_CAMPAIGN_INDEX_XN
      • Custom script: set udg_Campaign[7] = bj_CAMPAIGN_INDEX_XH
      • Custom script: set udg_Cinematic[0] = bj_CINEMATICINDEX_TOP
      • Custom script: set udg_Cinematic[1] = bj_CINEMATICINDEX_HOP
      • Custom script: set udg_Cinematic[2] = bj_CINEMATICINDEX_HED
      • Custom script: set udg_Cinematic[3] = bj_CINEMATICINDEX_UED
      • Custom script: set udg_Cinematic[4] = bj_CINEMATICINDEX_OED
      • Custom script: set udg_Cinematic[5] = bj_CINEMATICINDEX_NED
      • Custom script: set udg_Cinematic[6] = bj_CINEMATICINDEX_XOP
      • Custom script: set udg_Cinematic[7] = bj_CINEMATICINDEX_XED
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Name of (Picked player)) Equal to (==) Xirizo
            • Then - Actions
              • Set CPA = (Picked player)
              • Trigger - Turn on Map path set <gen>
              • Trigger - Turn on Ending Type <gen>
            • Else - Actions
  • Map path set
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
      • Player - Player 2 (Blue) types a chat message containing <Empty String> as An exact match
      • Player - Player 3 (Teal) types a chat message containing <Empty String> as An exact match
      • Player - Player 4 (Purple) types a chat message containing <Empty String> as An exact match
      • Player - Player 5 (Yellow) types a chat message containing <Empty String> as An exact match
      • Player - Player 6 (Orange) types a chat message containing <Empty String> as An exact match
      • Player - Player 7 (Green) types a chat message containing <Empty String> as An exact match
      • Player - Player 8 (Pink) types a chat message containing <Empty String> as An exact match
      • Player - Player 9 (Gray) types a chat message containing <Empty String> as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing <Empty String> as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing <Empty String> as An exact match
      • Player - Player 12 (Brown) types a chat message containing <Empty String> as An exact match
    • Conditions
      • (Triggering player) Equal to (==) CPA
    • Actions
      • Game - Set the next level to (Entered chat string)
JASS:
function Trig_Ending_Type_Actions takes nothing returns nothing
endfunction

//===========================================================================
function MyActions takes nothing returns boolean
    local integer i = 0
    loop
        exitwhen i > 7   
        if GetEventPlayerChatString() == udg_Endings[i] then
            call SetCampaignMenuRaceBJ( udg_Campaign[i] )
            call SetCinematicAvailableBJ( true, udg_Cinematic[i])
        endif   
        set i = i + 1
    endloop 
    return false
endfunction

function InitTrig_Ending_Type takes nothing returns nothing
    local trigger t = CreateTrigger()
    local integer i = 0
    loop
        exitwhen i > bj_MAX_PLAYER_SLOTS
        call TriggerRegisterPlayerChatEvent(t, Player(i), "", false)
        set i = i + 1
    endloop
    call TriggerAddCondition(t, Condition(function MyActions))
endfunction

It's cuz of that jas trigger.Because when i disable it.it can load without crashing.

And one more request can anyone make all this into jass.Since obviously GUI is making it unnececcery long.So if anyone can make this all in jass that would be great.

If you wondering what is the idea behind it it's.When map starts player named Xirizo is set to player type variable.So if he types something that will end up being the next load map.The second thing is he can set what kind of cinematic will it be when game ends (defeat/victory).Also make sure those two last triggers only responde to that player variable we set in beginning.

So yeah concept is pretty simple.I appreciate all the help.I have full GUI version it works perfectly it's just a bit longer so i wanted to try it out with jas.+Rep who helps me in this one.Thanks
 
Level 39
Joined
Feb 27, 2007
Messages
5,019
exitwhen i > bj_MAX_PLAYER_SLOTS will exit only when i == 17, bj_MAX_PLAYER_SLOTS is 16 (it counts neutral players). Player(i) only accepts 0 <= i <= 15 because player indices start at 0, not 1. Your loop then is causing a crash by attempting to do Player(16). Since you don't need to register neutral player chat events change it to exitwhen i >= 12.
 
Status
Not open for further replies.
Top