I meant when you collide with an object, it is deleted and added to inventory. I want the inventory to have words that are hilighted when mouse over ect.I want it also to be either a full screen menu or a tskbar like thing. Any questions? Here is the code with 547 lines cut out...
rem ////endnotes\\\\
rem Print instructions
set cursor 100,40
print "Press E/Escape Key to exit"
set cursor 100,60
print "Press the arrow keys to move"
set cursor 100,80
print "Press R to toggle movement modes"
set cursor 100,100
print "Press P/O to toggle camera"
set cursor 100,120
print "Press ctrl for god speed"
set cursor 100,140
print "Made by the Inerth Team"
suspend for key
cls
rem Set screen options
hide mouse
autocam off
set camera range 1,90000
sync on
rem Start positioning
x#=5000
z#=2500
plife#=100000
wpower# = 100
wpspeed = 10
rem Force area for test
area = 3
rem Set major anchor point
areaswap:
rem Store monsters data
dim monsterhp(5,10)
for x = 0 to 5
if area = 0 then monsterhp(x,1) = 5000
if area = 1 then monsterhp(x,1) = 2000
if area = 0 then monsterhp(x,3) = 5000
if area = 3 then monsterhp(x,3) = 10000
if area = 3 then monsterhp(x,1) = 10000
if area = 1 then monsterhp(x,3) = 2000
if area = 2 then monsterhp(x,1) = 3000
if area = 2 then monsterhp(x,3) = 3000
monsterhp(x,2) = x
next x
rem Prepare Settings
gosub createworld
gosub createplayer
gosub createplants
gosub createmonsters
remstart Make music
rem Only in the desert
if area = 0
load music "music/dance of darkness.mid",1
loop music 1
endif
rem Only in the cave
if area = 1
load music "music/my mind wanders.mid",1
loop music 1
endif
rem Only in the meadow
if area = 2
load music "music/field.mid",1
loop music 1
endif
rem Only at sky path
if area = 3
load music "music/hidden fury.mid",1
loop music 1
endif
remend
rem Start main loop
do
rem Get it to work!!!
rem Get & Display Time
rem ctime$ = get time$()
rem print ctime$
rem Store old values
oldx# = x#
oldy# = y#
oldz# = z#
rem Scroll the sky
if area = 0
if object exist(102) then scroll object texture 102,0.001,0.0001
if object exist(103) then scroll object texture 103,0.002,-0.002
endif
if area = 2
if object exist(102) then scroll object texture 102,0.001,0.0001
if object exist(103) then scroll object texture 103,0.002,-0.002
endif
if area = 3
if object exist(102) then scroll object texture 102,0.001,0.0001
if object exist(103) then scroll object texture 103,0.002,-0.002
endif
rem Control camera with arrow keys
if escapekey()=1 then end
if inkey$()="e" then end
if upkey()=1 & run = 0 then x#=newxvalue(x#,a#,5) : z#=newzvalue(z#,a#,5)
if upkey()=1 & run = 1 then x#=newxvalue(x#,a#,10) : z#=newzvalue(z#,a#,10)
if controlkey()=1 then x#=newxvalue(x#,a#,50) : z#=newzvalue(z#,a#,50)
if downkey()=1 then x#=newxvalue(x#,a#,-10) : z#=newzvalue(z#,a#,-10)
if leftkey()=1 then a#=wrapvalue(a#-10.0)
if rightkey()=1 then a#=wrapvalue(a#+10.0)
if inkey$()="o" then ha# = ha# + 1
if inkey$()="i" then gosub inventory
if inkey$()="p" then ha# = ha# -1
if inkey$()="r" and run = 0
run = 1
wait 100
endif
if inkey$()="r" and run = 1
run = 0
wait 100
endif
rem Control attacking
if spacekey()=1 & nata = 0
rotate limb 1,1,0,270,0
rem Check to see if attcking anything
for x = msn to men
if object collision(1,x)=1
for msearch = 0 to 5
if x = monsterhp(msearch,3) then minushp = monsterhp(msearch,2)
next msearch
monsterhp(minushp,3) = monsterhp(minushp,3) - wpower#
endif
if object exist(x) then patranome = patranome + 1
next x
wait 100
nata = 1
endif
rem Set some time for person/monster to escape
if dmg = 1
dmgend = dmgend + 1
if dmgend = 50
dmgend = 0
dmg = 0
endif
endif
if nata = 1
rotate limb 1,1,0,0,0
nxa = nxa + 1
if nxa = wpspeed
nata = 0
nxa= 0
endif
endif
rem Reset monster exist varible
patranome = 0
rem Test death
if plife#<1 then end
rem Rotate sword to old position
if spacekey()=0 then rotate limb 1,1,0,0,0
rem Monster attack damage
if dmg = 0
for x = msn to men
if object exist(x)
if object collision(1,x)>0
dmg = 1
plife# = plife# - monsterhp(1,1)
for c=0 to 255 step 20
cls rgb(c,0,0)
if fog available()=1
fog on
fog distance (0)
fog color (c*256*256)
sync
endif
next c
endif
endif
next x
endif
rem Death to the player if no life
if plife#=<1 then end
rem Fix changes
fog off
rem Update character
y#=get ground height(1,x#,z#)+50.0
position object 1,x#,y#,z#
yrotate object 1,a#
rem Handle sliding collision for player object with other objects
if object collision(1,0)>0
x#=oldx#
y#=oldy#
z#=oldz#
endif
rem Position camera to the back of the character
cx#=newxvalue(x#,wrapvalue(a#+180),100)
cz#=newzvalue(z#,wrapvalue(a#+180),100)
cy#=get ground height(1,cx#,cz#)+100.0
position camera cx#,cy#+ha#,cz#
rem Point camera at object
point camera x#,y#,z#
rem Ensure player doesn't walk up walls
fx#=0 : fz#=0
for r=0 to 35
ex#=newxvalue(x#,r*10,15)
ez#=newzvalue(z#,r*10,15)
eh#=get ground height(1,ex#+mx#,ez#+mz#)
if eh#<-50.0 then eh#=-50.0
force#=(eh#+50.0)/10.0
fx#=fx#+((ex#-x#)*force#)
fz#=fz#+((ez#-z#)*force#)
next r
x#=x#-(fx#/35.0)
z#=z#-(fz#/35.0)
rem Control monsters
gosub controlmonster:
rem Update screen
sync
rem End main game loop
loop
REM <--//!!!START OF SUB ROUTINES!!!\\-->
createworld:
rem Create identfier
make object plain 481,128,128
ghost object on 481
if area = 0 then load image "maps/desertt.bmp",81
if area = 1 then load image "maps/cavet.bmp",81
if area = 2 then load image "maps/meadowt.bmp",81
if area = 3 then load image "maps/sky patht.bmp",81
texture object 481,81
delete image 81
lock object on 481
position object 481,240,165,400
scale object 481,100,100,500
return
createplants:
return
rem ////////////////////////////////<>\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
createmonsters:
return
controlmonster:
rem Follow to monster attack point monsterhp 6,7,8 are for positions 9 is for attack
objct = 1
for g = msn to men
if objct = 7 then goto flon
if object exist(g)
rem Rid the world of a dead monster
if monsterhp(objct,3)<=0
delete object g
return
endif
monsterhp(objct,6) = object position x(g)
monsterhp(objct,7) = object position y(g)
monsterhp(objct,8) = object position z(g)
point object g,object position x(1),0,object position z(1)
if monsterhp(objct,9)<1
rem If player within view frustrum, activate
ex#=monsterhp(objct,6)-x#
ez#=monsterhp(objct,8)-z#
d#=sqrt(abs(ex#*ex#)+abs(ez#*ez#))
if d#<600.0
rem Monster finds you
monsterhp(objct,9)=1
endif
endif
rem Monster Stalks you till it dies
if monsterhp(objct,9)=1
if area = 3
if monsterhp(objct,6)<x# then monsterhp(objct,6)=monsterhp(objct,6)+5
if monsterhp(objct,6)>x# then monsterhp(objct,6)=monsterhp(objct,6)-5
if monsterhp(objct,8)<z# then monsterhp(objct,8)=monsterhp(objct,8)+5
if monsterhp(objct,8)>z# then monsterhp(objct,8)=monsterhp(objct,8)-5
monsterhp(objct,7) = get ground height(1,monsterhp(objct,6),monsterhp(objct,8))
position object g,monsterhp(objct,6),monsterhp(objct,7),monsterhp(objct,8)
endif
if area = 2
if monsterhp(objct,6)<x# then monsterhp(objct,6)=monsterhp(objct,6)+3
if monsterhp(objct,6)>x# then monsterhp(objct,6)=monsterhp(objct,6)-3
if monsterhp(objct,8)<z# then monsterhp(objct,8)=monsterhp(objct,8)+3
if monsterhp(objct,8)>z# then monsterhp(objct,8)=monsterhp(objct,8)-3
monsterhp(objct,7) = get ground height(1,monsterhp(objct,6),monsterhp(objct,8))
position object g,monsterhp(objct,6),monsterhp(objct,7),monsterhp(objct,8)
endif
if area = 1
if monsterhp(objct,6)<x# then monsterhp(objct,6)=monsterhp(objct,6)+3
if monsterhp(objct,6)>x# then monsterhp(objct,6)=monsterhp(objct,6)-3
if monsterhp(objct,8)<z# then monsterhp(objct,8)=monsterhp(objct,8)+3
if monsterhp(objct,8)>z# then monsterhp(objct,8)=monsterhp(objct,8)-3
monsterhp(objct,7) = get ground height(1,monsterhp(objct,6),monsterhp(objct,8))
position object g,monsterhp(objct,6),monsterhp(objct,7),monsterhp(objct,8)
endif
if area = 0
if monsterhp(objct,6)<x# then monsterhp(objct,6)=monsterhp(objct,6)+4
if monsterhp(objct,6)>x# then monsterhp(objct,6)=monsterhp(objct,6)-4
if monsterhp(objct,8)<z# then monsterhp(objct,8)=monsterhp(objct,8)+4
if monsterhp(objct,8)>z# then monsterhp(objct,8)=monsterhp(objct,8)-4
monsterhp(objct,7) = get ground height(1,monsterhp(objct,6),monsterhp(objct,8))
position object g,monsterhp(objct,6),monsterhp(objct,7),monsterhp(objct,8)
endif
endif
position object g,monsterhp(objct,6),monsterhp(objct,7),monsterhp(objct,8)
endif
objct = objct + 1
next g
flon:
objct = 1
return
rem BLOCK OFF!!!!!!!
end
byby:
for x = 1 to 10000
if object exist(x) then delete object x
next x
for x = 1 to 5
if matrix exist(x) then delete matrix x
next x
undim monsterhp
goto areaswap
return