[Include] [INC] Object Grouping
#1

[INC]Object Grouper
by Thanatos [Ignas1337]
I've been cycling through forums today and came up with an idea. What I have done is an object grouping system which allows all objects to move together with a slight desync on slower cpus as it needs time to cycle through objects and check if they're in a group. Now I'l explain the functions.

init_GroupedObjects();
This function must be put ongamemode init to reset the group count, as it starts with 1, and the minimum group id is 0, so...

CreateObjectGroup(float, float:y, float:z)
This function here creates a group with coordinates x, y and z. You might wonder why I use group coordinates but I do so because I will need offset for moving the group later.

AddObjectToObjectGroup(object_groupid, objectid)
This function simply assigns an object objectid to group object_groupid

CreateGroupObject(modelid, groupid, float:aX, float:aY, float:aZ, float:arX, float:arY, float:arZ);
The function creates an object already assigned to a groupid. I use the letter a before the floats because in the include the simbols are already defined, so it cannot repeat.

MoveObjectGroup(groupid, float:newX, float:newY, float:newZ, floatpeed);
This function moves all objects that are in groupid with the same offset to group coordinates, although the group coordinates change.

Hope you enjoy!

Downloads
Pastebin
Reply


Messages In This Thread
[INC] Object Grouping - by Ignas1337 - 27.06.2009, 11:45
Re: [INC] Object Grouping - by [NL]Bank - 27.06.2009, 11:48
Re: [INC] Object Grouping - by Ignas1337 - 27.06.2009, 11:50
Re: [INC] Object Grouping - by yezizhu - 27.06.2009, 11:52
Re: [INC] Object Grouping - by Chaprnks - 27.06.2009, 12:28
Re: [INC] Object Grouping - by Ignas1337 - 27.06.2009, 13:44
Re: [INC] Object Grouping - by mysan - 28.06.2009, 20:23
Re: [INC] Object Grouping - by NeRoSiS - 28.06.2009, 20:25
Re: [INC] Object Grouping - by Ignas1337 - 29.06.2009, 06:48
Re: [INC] Object Grouping - by NeRoSiS - 02.07.2009, 20:57

Forum Jump:


Users browsing this thread: 1 Guest(s)