View Full Version : Objects with CreateDynamicObject gone

20/01/2015, 04:38 PM
I have a problem.
Objects which are with CreateDynamicObject are gone.
Objects which are with CreateObject are OK.
Any ideas?
What's the difference and why this problem is?

20/01/2015, 04:41 PM
I've also had a whole lot of problems with that stuff lately.

How are you saving the objects, or are they coded into the script?

20/01/2015, 05:23 PM
They are in the gamemode.

20/01/2015, 06:22 PM
Could you paste at least one of the CreateDynamicObject lines?

Also what function is it in?

21/01/2015, 12:07 PM
CreateDynamicObject(17084,4061.19555700,-9095.33691400,-10.16438900,0.00000000,0.00000000,-89.99998128); //object(6)
That's in OnGameModeInit :)

21/01/2015, 12:46 PM
CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 200.0, Float:drawdistance = 0.0);

You've not followed the correct arguments.

CreateDynamicObject(modelid, X, Y, Z, RX, RY, RZ, -1, -1, -1, 200.0, 0.0);

That is one that I have in my gamemode. Try adapting to it, if you have any more issues/questions feel free to ask.

25/01/2015, 11:40 AM
Any other ideas?

25/01/2015, 12:46 PM
Any other ideas?


1) make sure your script that contains CreateDynamicObject is using YSI include

#include <YSI\y_ini>

2) Your Code have unneeded more numbers , i removed it , now try to use this code and it shall work :

CreateDynamicObject(17084,4061.1955570,-9095.3369140,-10.1643890,0.0000000,0.0000000,-89.9999813); //object(6)

The changes :
CreateDynamicObject(17084,4061.19555700,-9095.33691400,-10.16438900,0.00000000,0.00000000,-89.99998128); // YOUR CODE
CreateDynamicObject(17084,4061.1955570,-9095.3369140,-10.1643890,0.0000000,0.0000000,-89.9999813); //THE NEW CODE

25/01/2015, 05:49 PM
1. Y_Ini is included.
2. I do not think the problem is in the numbers, because to some time ago everything was working and suddenly began to not display the objects.

25/01/2015, 06:12 PM
This happened to me where i forgot i had a stock "LoadObjects" under OnGamemodeInit that loaded Dynamic objects, and then i placed some other CreateDynamicObject lines under OnGamemodeInit, instead of the stock.

It also might be because you're using too many normal objects with too many Dynamic ones, and are therefore hitting the limit.
You can have 1000 objects with CreateObject.
But CreateDynamicObject doesn't just remove the limit, it works by switching the objects that players can see, and thereby having over 1000 objects, while players can only see 500 or something.

So therefore if you have alot of normal objects, it will decrease the dynamic objects that can be switched.
Etc. no normal objects, and a player is close enough to see 200 new objects in an area. (A bit unrealistic, but lets just say that)
And then there's 1000 objects with CreateDynamicObject.

1000 Dynamic Objects that are invisible. (Doesn't matter to the limit)
200 Dynamic Objects that can be seen by the player. (Counts towards the limit)

But if you have 800 normal objects, and a player in an area with 300 dynamic objects, it wont work.

800 Normal Objects that are always visible. (Counts towards the limit)
300 Dynamic Objects that can be seen by the player. (Counts towards the limit)
= 1100 objects, while the limit is 1000, thereby making less Dynamic Objects so they cannot be seen.

Basically, using many normal objects while using Dynamic objects can be a mess.