|
|
slots and movement limits
#142578
07/21/07 18:08
07/21/07 18:08
|
Joined: Mar 2006
Posts: 752 Portugal
demiGod
OP
User
|
OP
User
Joined: Mar 2006
Posts: 752
Portugal
|
Hi, I am creating some columns of empty slots this way: Code:
var slotsPosition[27] = -1700,0,100, -1275,0,100, -850,0,100, -425,0,100, 0,0,100, 425,0,100, 850,0,100, 1275,0,100, 1700,0,100;
var slotsHandle[10]; var slotsIndex = 0; var slotsCount = 0; entity* tempSlots; define _slotID, skill99; var numberSlots = 9;
//@ function create_slots() { while(slotsIndex < 27) { slotsCount += 1; temp.x = slotsPosition[slotsIndex]; temp.y = slotsPosition[slotsIndex + 1]; temp.z = slotsPosition[slotsIndex + 2]; if(slotsIndex < 27) { tempSlots = ent_create ("kugel.mdl",temp,null); } tempSlots._slotID = slotsCount; slotsHandle[slotsCount] = handle(tempSlots); slotsIndex += 3; } }
As you can see in the image below the slots can be fullfilled with an object each one:  But i want to limit the x coordinates of the fullfilled slots and they must move always at same distance from each other. Imagine the movement of the foosball / table soccer rods with the players in it to understand what i am looking for. I tried many possible solutions but some of them need too much calculations and i know there is a simpler approach, but i didnt found it yet.. O_o So, i hope someone could point me in the right direction. Thanks in advance. Cheers
|
|
|
Re: slots and movement limits
[Re: demiGod]
#142583
08/03/07 17:37
08/03/07 17:37
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
ok, thanks, I understand you perfectly now... However, this is a rather hard question (otherwise you wouldn't have asked  ). I'm gonna go outside and have a cig to think about it. brb.
xXxGuitar511 - Programmer
|
|
|
Re: slots and movement limits
[Re: xXxGuitar511]
#142584
08/04/07 14:31
08/04/07 14:31
|
Joined: Mar 2006
Posts: 752 Portugal
demiGod
OP
User
|
OP
User
Joined: Mar 2006
Posts: 752
Portugal
|
Hey xXxGuitar511, such a long cigar btw  Please, i dont want you to have lung problems because of me  I am just kidding. Just wanna thank you anyway i will try to solve this question in some other way.. Cheers.
|
|
|
Re: slots and movement limits
[Re: frazzle]
#142586
08/05/07 01:01
08/05/07 01:01
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
Yeah, I didn't come up with any ideas, and I didn't want to spam saying that I had no idea... lol.
The only thing I can really think of is to use an additional object for collision. A model with collision shapes at the defined positions... But this isn't good.
Another thought was to store all of the collision info into an array as well. Then you can scan through the array after every move. EX_ If an entity hits an object, then store in the array how far it moved before it collided. Then after all objects have moved, scan through the array, and move all of the objects the shortest distance found in the array. Yes, this will work. You'll just have to set it up properly. If you need any help/ideas of how to set this up, then I can try to write an example when/if I find time...
xXxGuitar511 - Programmer
|
|
|
|