javaplaza Posted December 8, 2019 Share Posted December 8, 2019 (edited) I'm familiar with CK and basic papyrus, but now I'm moving onto to harder things. Since I'm not sure how to script what I'm trying to do, this may be a bit confusing. If it is, just say so, I'll do my best to explain. The player will be shown a messagebox with multiple enemy types to select from (they are able to choose more than one). Once their selection is made, my script takes the enemy list and randomly selects one at a time for random-attacks on a specific location. I'm aware of the randomInt function, and successfully got that working. But I'm less familiar with arrays. Thanks in advance, java Edited December 8, 2019 by javaplaza Link to comment Share on other sites More sharing options...
javaplaza Posted December 8, 2019 Author Share Posted December 8, 2019 the part i dont know how to do is fill the array with the players choices . Link to comment Share on other sites More sharing options...
ReDragon2013 Posted December 9, 2019 Share Posted December 9, 2019 (edited) Message PROPERTY msg auto ; the messagebox to show enemy types FormList PROPERTY List01 auto ; type 1 FormList PROPERTY List02 auto ; type 2 FormList PROPERTY List03 auto ; type 3 Int choice ; [default=0] ;---------------------------------- Actor FUNCTION myF_GetRandomActor() ;---------------------------------- formList fml IF (choice == 1) fml = List01 ELSEIF (choice == 2) fml = List02 ELSEIF (choice == 3) fml = List03 ENDIF int i = fml.GetSize() - 1 IF (i >= 0) i = Utility.RandomInt(0, i) RETURN fml.GetAt(i) as Actor ENDIF RETURN None ENDFUNCTION ;------------------ FUNCTION myF_Menu() ;------------------ choice = msg.Show() ENDFUNCTION Edited December 9, 2019 by ReDragon2013 Link to comment Share on other sites More sharing options...
javaplaza Posted December 9, 2019 Author Share Posted December 9, 2019 (edited) -deleted- Edited December 9, 2019 by javaplaza Link to comment Share on other sites More sharing options...
javaplaza Posted December 9, 2019 Author Share Posted December 9, 2019 (edited) The way ive made my mod, there is one list of enemy types. (not a form list, so far its only location is in a script.)ie: -bandits -warlocks -giants -forsworn By default, the player will have to defend the location from random attacks (one enemy type at a time of course) based off that list. The player has the option to toggle (turn off/on) any of those enemy types via a messagebox menu. I'm not sure the code above does this, it seems the it allows you to select one of the enemy types, not more than one. Edited December 9, 2019 by javaplaza Link to comment Share on other sites More sharing options...
ReDragon2013 Posted December 9, 2019 Share Posted December 9, 2019 You have written a lot, but I miss script code to understand what are you looking for.Keep in mind: you have an issue and other users want to help without your knowlegde of the mod. Link to comment Share on other sites More sharing options...
javaplaza Posted December 9, 2019 Author Share Posted December 9, 2019 when i wrote this blog i didn't have a code at all, because i don't know how to do what i am trying to accomplish. simply put, i was asking how to fill an array with variables the player chooses from a messagebox menu. after a lot of tinkering, i may be onto something right now, will update with my code when its complete Link to comment Share on other sites More sharing options...
Recommended Posts