mob
proc
line=14 Attack{mob/M in oview{1,}
var/damage = rand{,1 usr.strength}
damage -= defence
M.health -= damage
M.DeathCheck()
i lables line 14 and the error is expected expression can anyone help me out please.
ID:149118
Jul 2 2002, 6:59 am
|
|
In response to Skysaw
|
|
i changed it now i get this error
mob proc Attack(mob/M in oview(1) var/damage = rand(1, usr.strength) damage -= defence M.health -= damage M.DeathCheck() monsters.dm:15:error: var: missing comma ',' or right-paren ')' |
In response to Ss5trunks99
|
|
Ss5trunks99 wrote:
i changed it now i get this error |
In response to Skysaw
|
|
thanks
now i have errors all over this code mob monsters var think_dalay = 10 New() ..() spawn(rand(1,think_delay))AILoop() proc/AILoop() var/action_taken for(mob/M in oview(src)) if(istype(M,/mob/monsters)) continue //it doesn't attack monsters step_toward(src,M) action_taken = 1 for(mob/monsters/M in oview(1,src)) if(istype(M,/mob/monsters)) continue Attack(M) action_taken = 1 if(action_taken) spawn(think_delay) AILoop() return ..() monsters.dm:16:error:defence:undefined var monsters.dm:31:error:mob:undefined var monsters.dm:31:error:M:undefined var monsters.dm:32:error:M:undefined var monsters.dm:34:error:M:undefined var monsters.dm:34:error:step_toward:undefined proc monsters.dm:36:error:mob:undefined var monsters.dm:36:error:monsters:undefined var monsters.dm:36:error:M:undefined var monsters.dm:37:error:M:undefined var monsters.dm:39:error:M:undefined var monsters.dm:28:error:think_delay:undefined var monsters.dm:41:error:action_taken:value not allowed here monsters.dm:42:error:think_delay:value not allowed here monsters.dm:43:error::empty type name (indentation error?) monsters.dm:44:error:return :instruction not allowed here monsters.dm:42:error::empty type name (indentation error?) monsters.dm:17:error:M.health:undefined var monsters.dm:14:error:Attack :duplicate definition stats.dm:16:error:Attack :previous definition monsters.dm:31:/ :warning: statement has no effect monsters.dm:31:error::bad assignment monsters.dm:32:if :warning: if statement has no effect monsters.dm:36:/ :warning: statement has no effect monsters.dm:36:error::bad assignment monsters.dm:30:action_taken :warning: variable defined but not used |
In response to Ss5trunks99
|
|
Ss5trunks99 wrote:
thanks Seems like you haven't been defining many of your variables, and you seem to have a weak grasp on how BYOND even works. I would recommend reading some of the tutorials that are provided in the Tutorial section of the website before you attempt writing a game on your own. :) - Malver |
In response to Ss5trunks99
|
|
There is a lot wrong here. Try adding just a little bit of code at a time, and see what works. Here's what I noticed off the bat. There's probably more, but it's a tangle.
mob You may need to work on something a little simpler, until you get a better grasp of the language. |
In response to Skysaw
|
|
Skysaw wrote:
There is a lot wrong here. Try adding just a little bit of code at a time, and see what works. Here's what I noticed off the bat. There's probably more, but it's a tangle. thats the last one monsters.dm:28:error: proc definition not allowed inside another proc |
In response to Malver
|
|
Malver wrote:
Ss5trunks99 wrote: thanks for the tip mal but i have gone through the codes it isnt that i didnt name vars it was indents and one mispell |
In response to Ss5trunks99
|
|
what's with all the "> >"s?? It looks like you are cramming several lines together in a couple of places. What are you trying to do?
|
In response to Skysaw
|
|
thats how it pasted onto the forum it really isnt like that in my code
|
In response to Ss5trunks99
|
|
Ss5trunks99 wrote:
thats how it pasted onto the forum it really isnt like that in my code Paste it in a way that it looks like your code. |
In response to Skysaw
|
|
mob
monsters var think_delay = 10 New() ..() spawn(rand(1,think_delay))AILoop() proc/AILoop() var/action_taken for(var/mob/M in oview(src)) if(istype(M,/mob/monsters)) continue //it doesn't attack monsters step_towards(src,M) action_taken = 1 for(mob/monsters/M in oview(1,src)) if(istype(M,/mob/monsters)) continue Attack(M) action_taken = 1 if(action_taken) spawn(think_delay) AILoop() return ..() |
In response to Ss5trunks99
|
|
Ss5trunks99 wrote:
mob |
In response to Skysaw
|
|
do you have aim or msn so i can sow you how the code really works
|
Those should be (parens), not {braces}