ID:141858
 
Code:
        Wind(dir)
if(dir == 7 ) return "Northwest"
if(dir == 8 ) return "North"
if(dir == 9 ) return "Northeast"
if(dir == 6 ) return "East"
if(dir == 3 ) return "Southeast"
if(dir == 2 ) return "South"
if(dir == 1 ) return "Southwest"
if(dir == 4 ) return "West"
..()

Wind2(dir)
Wind()
walk(src,dir)
..()


obj
log
icon = 'log.dmi'
HP = 1
density = 1
Wind2()


Problem description:

I set this up thinking that the log once created would have the pre-defined variable HP and would call the Wind2 proc. The wind 2 proc would call Wind and get a direction (for instance, 6) and return the direction for Wind to be put in walk and give the object a direction to move constantly.
Zique wrote:
I set this up thinking that the log once created would have the pre-defined variable HP

There is no predefined variable HP. If you want logs to have inherited health, you need to define HP for objs.

and would call the Wind2 proc. The wind 2 proc would call Wind and get a direction (for instance, 6) and return the direction for Wind

It is returning the direction, but you're not doing anything with that direction that is returned. All Wind() is doing is returning a direction, so just calling it on a line by itself equates to almost the same thing as putting the number 2 (for south) on a line by itself. SOUTH means something, but SOUTH on a line by itself does nothing (but generate an error)

You want to do something like dir=Wind(), setting dir to the return value of Wind().
In response to Loduwijk
Also, "North", "South", etc., isn't recognized as a direction by the compiler. The directions are:
(Actual Direction/Macro Definition, either one works in DM)
1/NORTH
2/SOUTH
4/EAST
5/NORTHEAST
6/SOUTHEAST
8/WEST
9/NORTHWEST
10/SOUTHWEST

These are all without quotation marks.
In response to Kaiochao
You forgot up and down, which are 16 and 32 (maybe respectively; don't know the direction numbers for the normal directions, let alone these!) :P
In response to Jeff8500
mob/Login()
src<<"UP: [UP]"
src<<"DOWN: [DOWN]"


UP: 16
DOWN: 32


:)