ID:179014
 
im having problems with some attack codes I got from the demos section ive been looking over it all night and of course there are still some things I dont understand but when I compile the code I get one error: base EventCycle undefined proc

New()
next_action_time = world.time + rand(10)
return ..()

base_EventCycle(world_time)
if (next_action_time <=world_time)
if (isDead())
return
TakeAction()
next_action_time = world_time + action_delay

im not sure why im getting this error can someone help me out ?
thanks
Treasurecat wrote:
im having problems with some attack codes I got from the demos section ive been looking over it all night and of course there are still some things I dont understand but when I compile the code I get one error: base EventCycle undefined proc

New()
next_action_time = world.time + rand(10)
return ..()

base_EventCycle(world_time)
if (next_action_time <=world_time)
if (isDead())
return
TakeAction()
next_action_time = world_time + action_delay

Maybe you could put the base_EventCycle somewhere else as proc/base_EventCycle; then, you can just call the proc within New(). Also, you may want to check your indentation.
In response to Gakumerasara
this got real confusing real fast I tried indenting and moving the command and it did nothing I even took it out but the attack engine didnt do what I wanted and since I dont understand it anyway I decided to start writing one specified to my needs however one problem I am having is this.

mob/romulan
icon = 'person.dmi'
icon_state = "romulan"
hp = 5
verb/shoot_romulan()
New()
walk_rand(src,50)


how can I make this verb do random damage to this mob?

thanks for all the help guys.
In response to Treasurecat
Treasurecat wrote:
this got real confusing real fast I tried indenting and moving the command and it did nothing I even took it out but the attack engine didnt do what I wanted and since I dont understand it anyway I decided to start writing one specified to my needs however one problem I am having is this.

mob/romulan
icon = 'person.dmi'
icon_state = "romulan"
hp = 5
verb/shoot_romulan()
New()
walk_rand(src,50)


how can I make this verb do random damage to this mob?

thanks for all the help guys.

You should take a look at your indentation, again. If the romulan is using the verb, it should be on the same level as icon, hp, etc. Maybe you intended something like this?

mob/romulan
icon = 'person.dmi'
icon_state = "romulan"
verb/shoot_romulan()
[your code for dealing damage, etc.]
New()
walk_rand(src,50)
hp = 5 //you want to give it this hp to start with, right?
In response to Treasurecat
. . . or, if someone else is doing the damage, you should probably put your attack verb under something else besides Romulan, perhaps mob/verb/attack.
In response to Gakumerasara
the romulan isnt using the verb its just atached to him I only want that verb availible when the romulan is near by my indentation is working I dont have any errors but I can see I messed up a little when I posted I didnt indent the last line but its working ok I just had the question of how to add random damage to this cade for the romulan i.e. every time the verb is used the romulan takes damage?
In response to Treasurecat
I'm not sure if this will work or not, but it's worth a shot. You'd probably be better off making a unique code, but this is one possible way.

mob/romulan
var/hp //define it here, otherwise it may not apply outside of New()
icon = 'person.dmi'
icon_state = "romulan"
verb/shoot_romulan()

set src in oview(attack_range) //I don't know if this would work since romulan isn't an object.

romulan.hp -= rand(1,5) //however much damage you want to do

New()
walk_rand(src,50)
hp = 5 //modify hp here to start
In response to Gakumerasara
ok this is what I have

mob/romulan
icon = 'person.dmi'
icon_state = "romulan"
hp = 5
verb/shoot_romulan()
set src in oview(5)
romulan.hp -= rand(1,5)



New()
walk_rand(src,50)

its giving me several errors mostly on the romulan.hp saying duplicate defenitions and also set src in oview is not allowed there it says im not getting any bad var errors though what do you think I should do to get rid of those errors?
In response to Treasurecat
Treasurecat wrote:
ok this is what I have

mob/romulan
icon = 'person.dmi'
icon_state = "romulan"
hp = 5
verb/shoot_romulan()
set src in oview(5)
romulan.hp -= rand(1,5)



New()
walk_rand(src,50)

its giving me several errors mostly on the romulan.hp saying duplicate defenitions and also set src in oview is not allowed there it says im not getting any bad var errors though what do you think I should do to get rid of those errors?

I'll have to go soon, so someone else will have to help you in a bit. I noticed you placed your verb under hp, but doesn't the verb belong to the romulan? The rest of what you have under the verb will do nothing if not indented under the verb. The only way I can think of to have the verb appear when the romulan is within range is to make it an object and use "set src in oview([range])" indented under the verb. Do you have hp defined as mob/var/hp somewhere else? If not, that may be a problem. Setting hp to 5 will not do anything if it is not within a proc or defined where you set the value. You may want to change your verb definition argument to (mob/M in view(0)), which would set the target as the romulan itself, then you can use M.hp -= [damage], etc. I hope I helped; good luck with your coding.
In response to Gakumerasara
thanks for the help your right almost all my errors went away when I indented it properly.

mob/romulan

icon = 'person.dmi'
icon_state = "romulan"

hp = 5
verb/shoot_romulan(mob/M in view(5))
set src in oview(5)
romulan.hp -= rand(1,5)

of course the one problem that I still have is what you were pointing out a bad var romulan.hp I know you were trying to explain this to me but I dont understand how to associate hp as a var under mob/romulan I do have this as my first code.

mob
icon = 'person.dmi'
var
hp = 10
cp = 0
cl = 9
pow = 3

I tried changeing the var to something else like rp but it still gave me the same error. so ive been looking at the demos and the reference thats why it took so long to get back to this post. ive tried a few different things but each one gives me more errors.

can someone help me out with this hp var?
In response to Treasurecat
ok this is wierd no ive changed it to this

mob/romulan

icon = 'person.dmi'
icon_state = "romulan"

hp = 5
verb/shoot_romulan(mob/M in view(5))
set src in oview(5)
src.hp -= rand(1,5)



New()
walk_rand(src,50)

changeing the romulan.hp to src.hp and it got rid of the error however now when I try and use the verb it brings up a list like a switch command with the option of romulan or my key but choosing either one does nothing so I know I have two problems

I need to get rid of that list and
I need to make it so that when src.hp = 0 the src dies

please someone help