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 / Get Object Texture Scroll?

Author
Message
Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 27th Oct 2005 23:41
Is there a command to get the amount that an objects texture has scrolled in the x or y axis?

I am trying to get a snippet such as this one to work


If there is no command, what would be another good way to roll a ball?
Antidote
19
Years of Service
User Offline
Joined: 18th Mar 2005
Location: San Francisco, CA
Posted: 27th Oct 2005 23:44
rotate object commands.

xrotate object
yrotate object
zrotate object

why would you need to scroll the texture?

Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 28th Oct 2005 00:04
If i rotate the ball, then it will now point in another direction so when i move it forwards it will move down instead of forwards (if that makes sense).
Antidote
19
Years of Service
User Offline
Joined: 18th Mar 2005
Location: San Francisco, CA
Posted: 28th Oct 2005 00:40
dont use the move object command. What you need to do is at the beginning of a loop type this



This will make it so each loop the values of x# and z# are given the position of the object.

Then later on in the code put this line in.



What this does is it give the position variables you set earlier on the value of newxvalue(for x#) and newzvalue(for z#).

The way these commands work is they ask for the current position(corresponding to the name i.e. newxvalue(old x position))
the angle to move in. This means which direction they will move. I put the variable yang# so you can adjust the y angle for the object and move the object in that direction. Then the spd#. This stands for speed. you would put the speed you want the ball to move here.

Then after those you would put...



Now the ball can move in the direction you want it to, based on the y angle of the object. Use the yrotate object command to change that.

Now you can roll the ball with xrotate object and not move in a circle.

If you have any questions please reply. I'll be happy to go over anything in more detail.

Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 28th Oct 2005 00:57 Edited at: 28th Oct 2005 00:57
:S Woops sorry, i just realised i had loaded the old version of my game (the one using move object, i am now using

so the rotate object would work just fine. Thanks a lot for the 2nd post though i learnt a lot from that

Edit: Hmm it still doesnt seem to be working, it rolls, just it rolls wierd and after it hits a wall, the ball begins to shake.

Here is my code


Anyidea as to why it isnt working?
Antidote
19
Years of Service
User Offline
Joined: 18th Mar 2005
Location: San Francisco, CA
Posted: 28th Oct 2005 01:14
Well I havn't found the source of the weird rolling, but I wasn't looking for that really. I found why the ball shakes when it collides with the wall though.

What you need to do is take the...


You need to get rid of the else and the safex# and so on. Keep the endif

Take the safex# = x# and those three lines of code and put them above the collision section.

This might help. If it doesn't i'll help you get a slightly more sophisticated collision set up that will yeild better results.

I'll look into the code a bit more to see if I can help you find the problem with the rolling.

Antidote
19
Years of Service
User Offline
Joined: 18th Mar 2005
Location: San Francisco, CA
Posted: 28th Oct 2005 01:26


I think this may be the answer to the weird rolling. You can change some of the values if you want to. Also if this is not what your looking for you can always change it back.

Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 28th Oct 2005 12:33
Thanks a lot for fixing the shakey collision , the wierd rolling is still happening. At first i thought it may be an optical illusion from the texture but i tried changing the texture and that didnt work . I recorded a video in fraps but it is 7mb and i don't know where i can upload a file that size

Thanks a lot for the help so far
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 28th Oct 2005 15:19
you can upload upto10megs on here. also might be easier to upload the source and media.


Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 28th Oct 2005 18:46
Here is the video.

Attachments

Login to view attachments
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 29th Oct 2005 14:23
Quote: "why would you need to scroll the texture?"


if you rotate a cube, it would look different and the vertexes would point everywhere BUt where they're ment to scrolling the texture keeps the object the same, just not the texture


Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 29th Oct 2005 21:02
While i am still on the subject of this game, how do you get the reciprocal(sp?) of a tangent? (Tan^-1)

This doesnt work
Antidote
19
Years of Service
User Offline
Joined: 18th Mar 2005
Location: San Francisco, CA
Posted: 29th Oct 2005 21:20
tan([insert variable name or value here]) * -1

Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 29th Oct 2005 21:34
Okay thanks . Has anyone checked that video yet to discover the source of the wierd rolling?
Antidote
19
Years of Service
User Offline
Joined: 18th Mar 2005
Location: San Francisco, CA
Posted: 29th Oct 2005 21:55
When I try to run the video I get some weird error. I did see the weird rolling but I have no idea how to fix it.

Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 29th Oct 2005 22:38
Okay thanks for trying anyway I guess i'll have to leave it like that for the moment and hope the problem will sort itself out. Thanks for all the help This is why i love these forums ^^.
jrowe
22
Years of Service
User Offline
Joined: 12th Oct 2002
Location: Here
Posted: 29th Oct 2005 22:57 Edited at: 29th Oct 2005 22:58
I think you mean arctan, often written as Tan^-1. You do this in db with the atan(angle) command.

http://dbp.tgchelp.com/index.php?nav=dbhelp&command=26

Tinnedhead Productions

For Fathers and Sons who enjoy wholy spirits.
Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 29th Oct 2005 23:46
Yes that was what i wanted Thanks. Btw, i partially fixed the rolling. Firstly i realised i left the old rotate command in ;p. I removed that and then i had to change this


to this



Now it is much improved although there is still one problem. This problem appears to be that the axis rotates with the sphere. Is there anyway around this?
Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 31st Oct 2005 23:20
No ideas? I may resort to just scrolling the texture if there is noway to stop the axis rotating and i find out how to get object texture scroll ;p
Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 1st Nov 2005 22:16
Also, for my map creator i have this code although i have one small hitch.



I would like to be able to compress this into a lot fewer lines, i would want to do this by doing something along the lines of this



But, i need to remove the quote marks from the A$ as currently A$ = "fd" and i want it to = fd. Is there anyway to do this?

Sorry if i havent explained this well

Login to post a reply

Server time is: 2024-11-27 14:20:38
Your offset time is: 2024-11-27 14:20:38