Posted: 17th Jun 2007 5:12
Yeah, I was just doing a test with the Tech model in darkMATTER... and I hit a problem since I'm a noob. Right now, since I haven't specified any actions, when I press (up arrow) my guy just stands there, floating across the terrain.

So... I want the Idle model to change to the Move model when I'm holding the (up arrow); how can I do this?

Sorry about the newbish question, I've just been stuck for like an hour.
Posted: 17th Jun 2007 13:39
...and I am sorry you were stuck, and I was busy. Try this, I think its right....been a while.

+ Code Snippet
REM Project: tech_x
REM Created: 6/17/2007 5:04:14 AM
REM
REM ***** Main Source File *****

rem These are the 6 animations contained in the Tech model.

#constant DMstatic = 0
#constant DMidle = 1
#constant DMmove = 2
#constant DMattack1 = 3
#constant DMimpact = 4
#constant DMdie = 5

dim DM_6AnimsPeople(6) as string

DM_6AnimsPeople(DMstatic) = "Static.x"
DM_6AnimsPeople(DMidle) = "Idle.x"
DM_6AnimsPeople(DMmove) = "Move.x"
DM_6AnimsPeople(DMattack1) = "Attack1.x"
DM_6AnimsPeople(DMimpact) = "Impact.x"
DM_6AnimsPeople(DMdie) = "Die.x"

global DMBase as string = "c:\program files\dark basic software\darkmatter\models\db\"
global modelname as string
global model as integer = 1
global i as integer
global idle as integer = 0
global move as integer = 0
global attack1 as integer = 0
global impact as integer = 0
global die as integer = 0

modelname = DMBase + "people\tech\l-tech-"
load object modelname + DM_6AnimsPeople(DMstatic), model, 1, 0
for i = 0 to 5
    append object modelname + DM_6AnimsPeople(i), model, total object frames(model) + 1
        select i
            case 0
                idle = total object frames(model)
                endcase
            case 1
                move = total object frames(model)
                endcase
            case 2
                attack1 = total object frames(model)
                endcase
            case 3
                impact = total object frames(model)
                endcase
            case 4
                die = total object frames(model)
                endcase
            case default
                endcase
        endselect
next i
position object model, 0.0, -0.5, 0.0
scale object model, 100, 100, 100
set object model, 1, 1, 1, 2, 1, 0, 0
set object smoothing model, 100
set object speed model, 10.0
set object interpolation model, 10.0
loop object model, idle, die


wait key
end


You control the animation by the frame boundaries. How exactly depends. Looping like this does is not the best way, but this will get you by for a while, anyway. This loops through all animations.
Posted: 17th Jun 2007 14:06
Sorry but I can't edit that again! It was not right after all! Replace the end part with this.

position object model, 0.0, -0.5, 0.0
scale object model, 100, 100, 100
set object model, 1, 1, 1, 2, 1, 0, 0
set object smoothing model, 100
set object speed model, 6.0
loop object model, idle

That is how to loop through the whole set.
Posted: 17th Jun 2007 20:22
Ok, thanks, I discovered myself that I could just have the controls control all models, and if upkey()=1 then hide model 10 : show model 11. Thanks tho,