ID:138989
 
I'm having trouble running an attack proc and the reason is that when I call the proc I'm not sure what to phrase in that position
confirmattack
Click()if(usr.delay == 0)
usr.delay = 1
// Attack proc here
usr.delay = 0

Attack(mob/P,mob/M,)
if(usr.turn == "Attack")
usr.delay = 1
usr.target = M
M.hp -= 50
if(M.hp == 0)
ExitBattle(usr)
usr.delay = 0

Any help would be appreciated
Wait.... What?
In response to Ocean King (#1)
Every time that I've tried to put in like Attack(usr) or something along those lines it hasn't ran the attack proc so I'm looking like for something I should put as the argument or not as the argument I don't know that's what I need help with.
In response to SprAlanJS (#2)
SprAlanJS wrote:
Every time that I've tried to put in like Attack(usr) or something along those lines it hasn't ran the attack proc so I'm looking like for something I should put as the argument or not as the argument I don't know that's what I need help with.


Why don't you just put all your delay vars and things inside of your attack proc or whatever so you don't need to make a seperate proc for that?
Presumably 'confirmattack' is an obj that the player clicks to attack.
Since your Attack proc needs both the attacker and the one being attacked, you'll have to have the player select a target before confirming their attack.
(Which you would store in a tmp var of the mob.)

Then, when they click, you would call <code>Attack(usr, selectedattackee)</code>
In response to Chaorace (#3)
        target1
screen_loc = "Menu:2:12,3:22"
Click()if(usr.delay == 0)
usr.delay = 1
usr.client.screen += BattleTarget1Select
usr.client.screen -= BattleTarget2Select
usr.client.screen -= BattleTarget3Select
usr.client.screen -= BattleTarget4Select
usr.delay = 0
select
layer = 3
icon_state = "select"
screen_loc = "Menu:2:12,3:22"
target2
screen_loc = "Menu:2:12,2:5"
Click()if(usr.delay == 0)
usr.delay = 1
usr.client.screen -= BattleTarget1Select
usr.client.screen -= BattleTarget3Select
usr.client.screen -= BattleTarget4Select
usr.client.screen += BattleTarget2Select
usr.delay = 0
select
layer = 3
icon_state = "select"
screen_loc = "Menu:2:12,2:5"
target3
screen_loc = "Menu:7:9,3:22"
Click()if(usr.delay == 0)
usr.delay = 1
usr.client.screen -= BattleTarget1Select
usr.client.screen -= BattleTarget2Select
usr.client.screen -= BattleTarget4Select
usr.client.screen += BattleTarget3Select
usr.delay = 0
select
layer = 3
icon_state = "select"
screen_loc = "Menu:7:9,3:22"
target4
screen_loc = "Menu:7:9,2:5"
Click()if(usr.delay == 0)
usr.delay = 1
usr.client.screen -= BattleTarget1Select
usr.client.screen -= BattleTarget2Select
usr.client.screen -= BattleTarget3Select
usr.client.screen += BattleTarget4Select
usr.delay = 0
select
layer = 3
icon_state = "select"
screen_loc = "Menu:7:9,2:5"


I have those already for targets that when you click the target it selects and then deselects for other buttons, but how do I make it so that I target between the 4 when you click that button?
In response to SprAlanJS (#5)
I'm not entirely sure what you're asking, but.. not to sound rude, but that code looks awful.

First of all, I'm not completely sure showing me the code without fully explaining what it does is really helping.

Secondly, I'd appreciate it if you explained in more detail and more clearly what you're trying to do.