Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Akow, TipmyPip, tomaslolo), 788 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
slots and movement limits #142578
07/21/07 18:08
07/21/07 18:08
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline OP
User
demiGod  Offline 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] #142579
07/22/07 18:26
07/22/07 18:26
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline OP
User
demiGod  Offline OP
User

Joined: Mar 2006
Posts: 752
Portugal
Huh? No ideas?

Re: slots and movement limits [Re: demiGod] #142580
08/02/07 21:15
08/02/07 21:15
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline OP
User
demiGod  Offline OP
User

Joined: Mar 2006
Posts: 752
Portugal
Well, one more time.
I tried other solutions but still have some problems.

Maybe today someone will be inspired...

Re: slots and movement limits [Re: demiGod] #142581
08/03/07 16:58
08/03/07 16:58
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
I tried, but I don't really understand your problem/goal...


xXxGuitar511
- Programmer
Re: slots and movement limits [Re: xXxGuitar511] #142582
08/03/07 17:16
08/03/07 17:16
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline OP
User
demiGod  Offline OP
User

Joined: Mar 2006
Posts: 752
Portugal
Hi, dont think its very hard to understand, but maybe i expressed not so well.

If you ever played a foosball / table soccer game you know there is rods with a different number of players that move along the respective rod.

Also, because the players always have the same distance between them, when one player collides with a wall, the others may stop too.

Actually what i want to do is a modular way to:

1 - create the slots (possible positions on the rods - already done)

2 - each rod may have an arbitrary number of players (fullfilled slots)

3 - in movement, the distance between players should be always the same

4 - have collision detection against the walls (and the players movement must stop on that direction)

I hope now its more clear..

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 Offline
Expert
xXxGuitar511  Offline
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 Offline OP
User
demiGod  Offline 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: demiGod] #142585
08/04/07 14:45
08/04/07 14:45
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Quote:


I'm gonna go outside and have a cig to think about it. brb.
Quote:


Hey xXxGuitar511, such a long cigar btw








It could be a cigarette too

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
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 Offline
Expert
xXxGuitar511  Offline
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

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1