ID:159477
 
Hi, im trying to change my battle system from a simple command list promt to a skin button layout which pops up when in battle then goes away after the battle, but i havent got much knownledge on skins >_< tried some things but it just didnt work at all. How would i go about this?




                var/list/commands = list("Fight","Item","Run")

var/command = input(A, "Please select a command.","Command?") in commands // Base commands to use from
switch(command)
if("Fight")
FightBattle(A, B)

...etc



(You forgot about "Switch" ;p)

Pass an arg from the button's command to the verb that executes the code for the corresponding option.

//command on the button
Verby "Fight"

//verb being called by the button's command
mob/verb/Verby(Command as text)
switch(Command)
if("Fight")
//fight code
if("Switch")
//switch code
if("Item")
//item code
if("Run")
//run code
In response to Spunky_Girl
verb? but all of these are procs... can buttons even call procs?


battle_sorters 
parent_type = /obj
var

mob/A //player
mob/B //monster

New(location, mob/a, mob/b)
..()
src.A = a
src.B = b
if(A&&B)
StartBattle(A,B)
StartChecking(A, B)


proc
StartChecking(mob/A, mob/B)
spawn while(src)
if(!A) LogOutBattle(A, B)
else if(!B) LogOutBattle(B, A)
sleep(25)


StartBattle(mob/A, mob/B)
A << sound()
A << sound ('Battle1.mid')
for(var/mob/characters/P in A.party)
P << sound ('Battle1.mid')


if(A.agi==B.agi)

if(prob(50))
var/tempvar = A
A = B
B = tempvar
EngageBattle(A, B)
else
if(A.agi > B.agi)
EngageBattle(A, B)
else
EngageBattle(B, A)

EngageBattle(mob/A, mob/B)


if(A.client)

var/list/commands = list("Fight","Item","Run")
var/command = input(A, "Please select a command.","Command?") in commands /
switch(command)
if("Fight")//want a button here instead of this ugly pop box D:
FightBattle(A, B)
if("Item")///want a button here instead of this ugly pop box D:
var/list/L = A.contents1
if(L.len)
var/item/I = input(A, "Pick an item to use","Item") in L + "Back"
if(I=="Back")
EngageBattle(A, B)
else
I.BattleUse(A)
EngageBattle(B, A)
else
A << "You do not have any items to use."
EngageBattle(A, B)
if("Run")///want a button here instead of this ugly pop box D:
RunFromBattle(A, B)
else // monster intelligence
MonsterBattle(A, B)




FightBattle(mob/A, mob/B)
var/list/commands = list("Attack","Skill",/*"Defend",*/"Wait")
var/command = input(A, "Please select a command.","Command?") in commands
switch(command)
if("Attack")
A.attack(B)
if(B.DeathCheck(A))
EndBattle(A, B, "win")
else
EngageBattle(B, A)


...etc
In response to Andrew001
Interface controls, such as buttons, cannot call procs, no. Only verbs. You're going to have to create a verb that calls the proc(s) you want the button to call.