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.

DarkBASIC Professional Discussion / Unsolvable problem possible?

Author
Message
HartZa
23
Years of Service
User Offline
Joined: 5th Jun 2003
Location:
Posted: 17th Jul 2003 20:04
I have a little problem with my code:
I made an island, which is model, not matrix.
How can i make any characters walk on it?
I've tried anything and i can't make it.
I know it will be just one command, but can't find it
So if anyone knows how to make this?
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 17th Jul 2003 20:24
It's not one command. It's many many many many commands. Have a look through at previous posts about this and you'll see how lovely and complex and not so easy doing that actually is.

Machine: P4 2200, 1GB RAM, GeForce4 64MB, Audigy Platinum
http://www.breakbeat-terrorism.co.uk
(It's not all about the coding)
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Jul 2003 20:36
Why should it be difficult?

1) You know your current location.
2) You know the object number of the terrain.

That, combined with INTERSECT OBJECT gives you all the information that you need.

Just do something like this (Where object 1 is the object you are controlling and object 2 is your terrain) :

HartZa
23
Years of Service
User Offline
Joined: 5th Jun 2003
Location:
Posted: 17th Jul 2003 22:02 Edited at: 17th Jul 2003 22:05
Hey thanks i gotta try this out!
I'm not very pro with coding, so this is why i got lost
But thanks anyway!!!!!

P.S: am i right: i need to use this kind of code for every object i'm going to keep on the terrain object? Or is there any way to solve it by one code snippet for multiple objects at once?

HartZa
23
Years of Service
User Offline
Joined: 5th Jun 2003
Location:
Posted: 17th Jul 2003 22:13
And one more question:
Let's say the Obj1 is the terrain object, and
Obj2 is the object i want to align on it.
So, if Obj2 is eg. a man, and i make 3rd person game, does the Obj2 stay on the Obj1? or does it keep going through of it?

HartZa
23
Years of Service
User Offline
Joined: 5th Jun 2003
Location:
Posted: 17th Jul 2003 22:30
I tried your snippet and it doesn't work...
I don't know what's the problem but when i insert it to my code
and run, it works ok, but the object i want to keep on the terrain just blinks really fast.
Any help?

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Jul 2003 22:46
Well, wadda ya know! It does - I've just been putting a little example program together and it does it for me. Don't worry, I'll fix it
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 17th Jul 2003 22:50
Can't wait to see this work of genius. Two lines of code, eh?

Machine: P4 2200, 1GB RAM, GeForce4 64MB, Audigy Platinum
http://www.breakbeat-terrorism.co.uk
(It's not all about the coding)
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Jul 2003 22:56
Actually, it was a simple oversight

Here is the corrected version from my first post.




Here's a complete demo
Just substitute your terrain object for object 1.

HartZa
23
Years of Service
User Offline
Joined: 5th Jun 2003
Location:
Posted: 18th Jul 2003 19:24
Thanks i gotta test this too

HartZa
23
Years of Service
User Offline
Joined: 5th Jun 2003
Location:
Posted: 18th Jul 2003 19:35
How's that helping me?

Look:
I have an island object, which is .X type of file, so it's model.
Now i want to make another .X to walk on it.
The island object is bumpy and hilly, not flat like in your demo.
So how's it possible to make?

Attreid
23
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 18th Jul 2003 19:46
he made a plain becaus ehe didn't want to join a .x file to his message, but his code can work with your island
try his code with your island instead of his plain

"He will come...the voice from the outer world,
bringing the holy war, the Jihad, which will cleanse the Universe and bring us out of darkness."
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Jul 2003 20:22
That's right. Just load your object as object 1 instead of all that 'plain' code and try it

Sorry, I just had to try that smiley and that one too
HartZa
23
Years of Service
User Offline
Joined: 5th Jun 2003
Location:
Posted: 18th Jul 2003 22:02
Ok thanks!!!
Works perfectly!!!!!!

Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 18th Jul 2003 23:36
Well, I'll be damned to hell and shoved up satans arse! Well done IanM. I haven't tried it myself, but I'm convinced and I eat my sarcasm and lick the gravy.

Good stuff.

Machine: P4 2200, 1GB RAM, GeForce4 64MB, Audigy Platinum
http://www.breakbeat-terrorism.co.uk
(It's not all about the coding)
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Jul 2003 23:53 Edited at: 18th Jul 2003 23:53
Ner! How dare you doubt me

Hmmm, need to get rich to remove some of these smileys - I'm spending more time deciding which ones to use next than I am answering posts
HartZa
23
Years of Service
User Offline
Joined: 5th Jun 2003
Location:
Posted: 19th Jul 2003 19:28
btw One more question:
Is there any kind of way to use only one function for every model i want to make walk on the terrain object?
Or should i just copy about 30 copies of this, just changing the numbers of objects?

And IanM, forget all other smileys - the only you need is
that looks funny!!!

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Jul 2003 20:01
I think what you're asking is if you have a terrain made up of many objects, can you just check the right one...

One way is to have a regular arrangement of terrain objects.

Just make sure that your objects are all the same size (width and depth, not height) and arrange them in a grid like this with the lower left corner being placed at 0,0,0 (object numbers shown):

1010 1011 1012 1013 1014
1005 1006 1007 1008 1009
1000 1001 1002 1003 1004

Then you can work out from your coordinates which object you are placed above. So if your objects are 100x100 units and you are placed at coordinate 425,155, then you will be placed above object 1009:

object=1000+int(x/100)+(int(y/100)*5)
where the 5 is the number of objects in each row

At least, this is the way that I did it ... oh, sorry. I meant
HartZa
23
Years of Service
User Offline
Joined: 5th Jun 2003
Location:
Posted: 19th Jul 2003 22:52
I didn't understand, sorry
But, i didn't mean that.
I mean, if i have two character objects and one terrain object, can i make BOTH of the character objects stay on the terrain object with one function?

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 20th Jul 2003 00:13
Yep. Just use that function I've given you, and call it twice - once for each object.
HartZa
23
Years of Service
User Offline
Joined: 5th Jun 2003
Location:
Posted: 20th Jul 2003 19:46
Oh, so i can't make just one function, working with every object?

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 20th Jul 2003 20:41
Well, yes you can. Just write a piece of code that calls the function I've provided once for every object you have.

Login to post a reply

Server time is: 2026-07-21 05:56:05
Your offset time is: 2026-07-21 05:56:05