Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
4 registered members (fogman, Grant, AndrewAMD, juanex), 989 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Local array or something similar? #433617
12/03/13 14:50
12/03/13 14:50
Joined: Jan 2006
Posts: 968
EpsiloN Offline OP
User
EpsiloN  Offline OP
User

Joined: Jan 2006
Posts: 968
I need a way to store 240 numbers for each player entity on a Server (or at minimum 64 numbers) to be used to track and reverse the movement to a certain point in time.

Is there a way to declare a local array for each player? I dont need globals, because the number of clients has no maximum, I need a local way.

PS.: I'm familiar with C-Script's limitations, but I'm hoping someone will reply with something for Lite-C :} Dont judge me if I'm asking magic here...



*EDIT*
I just went through the manual, and from what I understand, this limitation of a local array to 3 elements is removed in Lite-C.

Is this true or I got it wrong?

Last edited by EpsiloN; 12/03/13 15:21.

Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: Local array or something similar? [Re: EpsiloN] #433623
12/03/13 15:32
12/03/13 15:32
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
true. however it is better to use sys_malloc to allocate memory for local arrays.


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: Local array or something similar? [Re: sivan] #433643
12/03/13 18:31
12/03/13 18:31
Joined: Jan 2006
Posts: 968
EpsiloN Offline OP
User
EpsiloN  Offline OP
User

Joined: Jan 2006
Posts: 968
Sorry laugh but I cant find that function in the manual, or a file to include...

*EDIT* Nevermind , I was looking in the A6 manual grin
I'll check now, how to do this...


*EDIT2* I'm too new to Lite-C , so memory allocation looks extremely complicated to me. (Along with short , long , char and stuff laugh )
I guess I'll use a regular local array.

In case I'm gonna do something terribly wrong, tell me, I'll keep checking.

Last edited by EpsiloN; 12/03/13 18:40.

Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: Local array or something similar? [Re: EpsiloN] #433649
12/03/13 19:33
12/03/13 19:33
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
you could have memory issues if you create a lot of local arrays without memory allocation. you can easily allocate any type of arrays like:

var *myarray = (var*)sys_malloc(elements * sizeof(var));


Free world editor for 3D Gamestudio: MapBuilder Editor

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