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
iaretony
23
Years of Service
User Offline
Joined: 6th Jun 2003
Location:
Posted: 26th Jun 2003 08:18
Is their anyway to hold a vector2 in a type?

type skater
direction_vector as vector2
endtype

Thats kind of what I'd like to do, but of course that doesn't work. It appears that I can only hold floats, integers and strings in types. Bummer.

Tony
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 26th Jun 2003 10:18
Vectors are not true types, so you won't be able to do that. Why not hold the vector number instead in an integer?

type skater_t
direction_vector as integer
endtype

dim skater(10) as skater_t

skater(0).direction_vector = 1
null = make vector2 skater(0).direction_vector
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 26th Jun 2003 12:38
because you need to actually hold the Vector pointer Ian



you only need the vector number for creating them, when you destory them you need the pointer, it took me a few attempts when learning about the vectors to figure that.

however if all you want is a vector data setup



try to make sure when you exit the program you delete vectors.
delete vector pVecDir should be all you need

I pride myself that i don't kill...
well not without a good reason
iaretony
23
Years of Service
User Offline
Joined: 6th Jun 2003
Location:
Posted: 26th Jun 2003 19:30


Ok, this is WIERD! What is actually going on here? What is vec2count?

I guess what I'm surprised about is that you don't have to say:
Skater_t.direction_vector=make vector2(vec2count)

Does this imply that I cannot have any other structure member named "direction_vector"?

I guess I'm really confused...

Tony

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 26th Jun 2003 20:20
That's not right Raven. If I put in this code:



I get the number '1' displayed twice. I suspect that you're getting the built-in vector system and your own system confused, as I have used vectors to great effect using my understanding of them. In my experience, the MAKE VECTOR* functions always return a '1', not a pointer.

iaretony, just treat vectors in the same way as you would deal with an object - you have to create it, update/modify it and delete it. The number that you assign to the vector is up to you
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 26th Jun 2003 20:24
yeah probably... i've been using dx ones alot recently does get confusing - but i've had problems with DBPs builtin vectors quite a bit - i swear they change per version

I pride myself that i don't kill...
well not without a good reason

Login to post a reply

Server time is: 2026-07-16 12:18:18
Your offset time is: 2026-07-16 12:18:18