Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Variable Will not change

Author
Message
LLX
21
Years of Service
User Offline
Joined: 17th Feb 2003
Location:
Posted: 17th Mar 2003 00:12
still trying to set my colision zone, i know if i set the text string into the function it returns 1, so it is changing the variable but only if the object loads inside the trapzone, and if i leave the trap zone the variable remains 1, if i put text display in the main loop it repans at the default 0, im just not sure why i cant get it to check to seeifthe player object is inside the specified trap zone and change the varible to 1 if it is


`---------------------------
`UFG
`---------------------------
`http://UFG.LurkerLordX.com
`Codded by Nikolai Crumb with help for the DB
`Comunity for debugging
`---------------------------

rem --------
rem INCLUDES
rem --------
rem include the MatEdit LoadMatrix files
#include "LoadMatrix.dba"

rem ------
rem ARRAYS
rem ------
rem declare the MatEdit variables
Dim BigMatrix(600,600,1)
Dim StartLoc_X(1): Dim StartLoc_Z(1)im Info(2)
Dim TArrayX(1): Dim TArrayZ(1): Dim FKey(10,1)
Dim ColData(100): Dim ZoneData(100): Dim Tiles(500,500)
Dim OverTexture$(100): Dim OverName$(20): Dim ReplaceTex(100)
Dim MOffsetX(25): Dim MOffsetY(25)
Dim MWire(20): Dim MGhost(20): Dim Lock(20)
Dim MatX#(20): Dim MatY#(20): Dim MatZ#(20)
Dim MatWidth#(20): Dim MatHeight#(20)
Dim TilesX(20): Dim TilesZ(20)
Dim MatHi#(20): Dim MatLo#(20)

rem player array
dim xSpeed#(4)
dim ySpeed#(4)
dim zSpeed#(4)
dim friction#(4)
dim moveDist#(4)

rem set fog
FOG ON
FOG DISTANCE 0
FOG COLOR RGB(0,133,255)

rem set up the program
sync on
sync rate 60
hide mouse
autocam off

rem load the matrix
LoadMatrix("BASIC1",1)

rem temp turbuckles
make object cube 101, 2100
position object 101, 50000, 6300, 53000

`set light properties
set ambient light 50
color ambient light RGB(255,255,255)

rem set cameral draw range
set camera range 1,30000

`gravity
dim gravity#(0) : gravity#(0)=1.43

`--------------
`player loading
`--------------
`make a temporary player object
make object cube 1,500
position object 1, 31000, 5006, 35000

friction#(1)=0.97
moveDist#(1)=6.065
xSpeed#(1)=0
zSpeed#(1)=0

`temp player, the ship
load object "spaceship.x", 11
scale object 11,30,30,30
glue object to limb 11,1,0
position object 11,0,370,0
hide limb 1,0

dim xPos#(1) :xPos#=object position x(1)
dim yPos#(1) :yPos#=object position y(1)
dim zPos#(1) :zPos#=object position z(1)
currentHotspot=0

`---------
`MAIN LOOP
`---------
main:
do

`get keyboard input for movement
if upkey()=1 then forward=1 else forward=0
if downkey()=1 then backward=1 else backward=0
if leftkey()=1 then left=1 else left=0
if rightkey()=1 then right=1 else right=0

`update the player
move_player(1,forward,backward,left,right)

`update the camera
chase_cam(1)

`call trap check
trapcheck(1,xPos#,yPos#,zPos#)

text 10,10, "Welcome to the 3d walk around for UFG."
text 10,24, "FPS: " + str$(screen fps())
text 10,38, "Fog Available (1=Yes): " + str$(name=fog available())
text 10,52, "X Cordinate (Cube Base): " + str$(object position x(1))
text 10,66, "Y Cordinate (Cube Base): " + str$(object position y(1))
text 10,80, "Z Cordinate (Cube Base): " + str$(object position z(1))
text 10,94, "Ghost Available (1=Yes): " + str$(name= alphablending available())
text 10,108, "Texture Smoothing Available (1=Yes): " + str$(name= filtering available())
text 10,122, "Fast 2D w/3D Available (1=Yes): " + str$(name= 3dblit available())
text 10,136, "3D Card: " + current graphics card$()
text 10,150, "Total Vid Memory: " + str$(name=system dmem available())
text 10,164, "Total Sys Memory: " + str$(name=system smem available())
text 10,178, "Total Memory: " + str$(name=system tmem available())
text 10,192, "Softwhere Emulation Mode (1=Yes): " + str$(name=emulation mode())
text 10,206, "Transformation and Lighting Supported (1=Yes): " + str$(name=tnl available())
text 10,220, "In Triger Zone (1=Yes): " + str$(currentHotspot)

`update the screen
sync
loop

`---------
`hotzone/trap zone
`---------
function trapcheck(id,xPos#,yPos#,zPos#)

`find current hotspot
if xPos#>=30000.0 and xPos#=5000.0 and yPos#=30000.0 and zPos#99999 then xCamPos#=99998
if zCamPos#>99999 then zCamPos#=99998
if xCamPos#99995 then xPos#=99995
if zPos#>99995 then zPos#=99995
if xPos#
Kentaree
21
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 17th Mar 2003 01:13
Uhm, repost your code, its been cut off. But from what I see here one mistake already is xPos#=5000.0 and yPos#=30000.0 because that means there's only one position in the world that it'll work. Stick to < and > and you should be fine.

Whatever I did I didn't do it!
LLX
21
Years of Service
User Offline
Joined: 17th Feb 2003
Location:
Posted: 17th Mar 2003 02:48
darn you board



LLX
21
Years of Service
User Offline
Joined: 17th Feb 2003
Location:
Posted: 18th Mar 2003 05:22
hello?

LLX
21
Years of Service
User Offline
Joined: 17th Feb 2003
Location:
Posted: 18th Mar 2003 23:26
it be nice if someo nreplied now that the code is up

why is it the anser come in droves whe nthe subject is Nudity or SEX but when its logical...

xmen
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location:
Posted: 19th Mar 2003 00:19
`call trap check
trapcheck(1,xPos#,yPos#,zPos#)

you are passing 1 to your trap ckeck all the time

trapcheck(num,xPos#,yPos#,zPos#)
LLX
21
Years of Service
User Offline
Joined: 17th Feb 2003
Location:
Posted: 19th Mar 2003 05:40
no effect

Login to post a reply

Server time is: 2024-09-20 00:46:33
Your offset time is: 2024-09-20 00:46:33