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.

Author
Message
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 25th Mar 2005 21:37
I remember seeing in a few snippets that there was a way to get the object number that your "interacting" with.

Basically, I need to find out if the Object's Number is between 100-200 (Within this number range will be my ramps) when a collision occurs. It'd be much faster than checking for a collision for each object using up unneeded lines. Could someone explain how I could achieve this?

I dont think you'll need my code for it it's pretty basic, the old if object collision blah blah blah, I was thinking something along the lines of.


And collide# would be set to 1 when a collision occurs earlier on.

I think the only other way to do this is by using an array, atleast from what I know about them. But I've never attempted to use one before so I'd rather see if this could work instead.

Thanks in advance.

bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 25th Mar 2005 21:55
an array? nah, that's not what arrays are for... Less the ramps weren't set between 100 and 200..

Quote: "if collide#=1 and ObjID >0 and <11 then blah blah blah"


sounds about the simplest solution to me... however, this checks all objects still.. but only moves the person in a certain way if it lands between the values..


Yarr join teh New and Improved LoGD!
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 25th Mar 2005 22:02
No reason for my ramps to be moving . So could you explain how Id do this? Wait, is ObjID a predefined variable or something? If thats the case then piece of cake, Ill try right now and see if it is...

bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 25th Mar 2005 22:06
objID is not predefined

only functions return values.. like
OBJECT POSITION X() is a function that returns a predefined value..

To do this one.. you'd need the object the person collided with..

I *believe, and I may be wrong on this* that if you're using OBJECT COLLISION () function, or whatever the standard collision function is (i can't look it up right now) that it returns the object number you hit...

so like

objID = OBJECT COLLISION(playerobjectID,0)
where 0 means all objects..

Give that a try..


Yarr join teh New and Improved LoGD!
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 25th Mar 2005 22:11
Will do, thx for the fast reply.

RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 25th Mar 2005 22:17
Hmm...No errors ofcourse but it doesn't seem to be picking it up. Im just testing it with coloring the object when it collides.

Not workin'.

bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 25th Mar 2005 23:20 Edited at: 25th Mar 2005 23:22
does collide# ever equal one?

what you'd prolly want to do is::

IF objID# > 99 AND objID# < 201

because objID will be in between 100 and 200.. if objID > 0 then a hit was made, so you don't need the collide var at all.

Also, objID# doesn't need a "#" symbol... Object Id's are integer numbers, not floats.


Yarr join teh New and Improved LoGD!
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 25th Mar 2005 23:38
I had the between 99 and 201 thing I just shortened it to see if it would work for checking 1 object.

I see your point though no use in writing more than I need for the checking.

And I'll make a key set collision to 1 to see if ti works, but Im pretty sure collision does go to 1.

Oh I guess in this post I can test my Avi too...hmmm hope it works.

RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 25th Mar 2005 23:38
Damnit.

bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 25th Mar 2005 23:45 Edited at: 25th Mar 2005 23:46
objID# = OBJECT COLLISION(1,0)
IF COLLIDE# = 1 AND ObjID# = 100 THEN COLOR OBJECT 1,RGB(255,255,000)


From those two commands, how do you figure collide# = 1?

Unless you call OBJECT COLLISION twice (because this call doesn't change collide#, it changes objID#).. collide# will not change from 0.


Yarr join teh New and Improved LoGD!
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 25th Mar 2005 23:47
HAH! That solves everything. This is really weird lol.

See I was making a simpler version than the sliding collision you showed me, and when I ran it it worked but the code looked like it shouldnt have worked. Its really weird, basically it checks if collide equals 1 and then slides them, whats weird is you were right it never equals 1, yet it slides lol. BUT, When I make it equal 1 it freeks out and goes flyin off in a direction. Lol I know how I can fix it but its still weird XD.

RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 25th Mar 2005 23:48
Oh By the way, I was making collide equal one by using automatic collision, and as it's response it would make collide equal 1. Anyways I can make it work but its really weird lol it shouldnt work

bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 26th Mar 2005 01:08
hmm.. strange..

As long as it works, and works properly^_^


Yarr join teh New and Improved LoGD!

Login to post a reply

Server time is: 2024-09-23 15:33:50
Your offset time is: 2024-09-23 15:33:50