Dynamic Object Arrays -
Scenario - 21.07.2010
Okay, I know you can use arrays to add objects into your GM, but I don't know how to integrate this steamer into an object array for my server. Could someone please help me out, or possibly create a tutorial? Thanks!
Re: Dynamic Object Arrays -
Яσскѕтая - 21.07.2010
If I am understanding what you mean, you just use CreateDynamicObject instead of CreateObject.
Re: Dynamic Object Arrays -
Scenario - 21.07.2010
Correct, but instead of having this.
pawn Code:
CreateDynamicObject(...);
CreateDynamicObject(...);
CreateDynamicObject(...);
CreateDynamicObject(...);
CreateDynamicObject(...);
CreateDynamicObject(...);
CreateDynamicObject(...);
CreateDynamicObject(...);
CreateDynamicObject(...);
I could have.
pawn Code:
new Objects[x]
{
{objectID, ...}
{objectID, ...}
{objectID, ...}
{objectID, ...}
{objectID, ...}
{objectID, ...}
}
Its a little better doing that in my opinion, its especially nice if I wanted to make something so the first half is like "gate closed" and the second is "gate opened", etc.
Re: Dynamic Object Arrays -
Joe_ - 21.07.2010
A friend of mine named Kyosaur made a 'MTA MAP LOADER' (Just a snippet on the XML Thread) to load MTA maps, and convert them into SA-MP.
So you could just map the objects, save them (using MTA 1.0 ofcourse), then place them somewhere, and load them with the loader, you'll have to make an array listing every map name, though.
https://sampforum.blast.hk/showthread.php?tid=150755&page=3
It's on the 3rd page, 5 posts down, you'll have to figure out some stuff of your own though.
Re: Dynamic Object Arrays -
Яσскѕтая - 21.07.2010
Not sure if this is right but you could try
pawn Code:
new Objects[x]
{
{objectid, argument, argument...},
{objectid, argument, argument...} // Last one doesnt have a , all others do.
};
Then do like
pawn Code:
new rand = random(sizeof(randomSpawns));
CreateDynamicObject(Objects[rand][0], Objects[rand][1], Objects[rand][2] );
If that is what you are wanting. (Sorry if it's not im really not fallowing along with you :\)
Re: Dynamic Object Arrays -
Joe_ - 21.07.2010
I didn't know that, YSI Is rather unpopular, shouldn't be lol.
Re: Dynamic Object Arrays -
Scenario - 21.07.2010
Quote:
Originally Posted by Яσскѕтая
Not sure if this is right but you could try
pawn Code:
new Objects[x] { {objectid, argument, argument...}, {objectid, argument, argument...} // Last one doesnt have a , all others do. };
Then do like
pawn Code:
new rand = random(sizeof(randomSpawns)); CreateDynamicObject(Objects[rand][0], Objects[rand][1], Objects[rand][2] );
If that is what you are wanting. (Sorry if it's not im really not fallowing along with you :\)
|
Yes, that is what I am looking for. However, I need to be able to define what each "argument" is.
Quote:
Originally Posted by Y_Less
There is also an MTA map loader fully integrated in to YSI, which also has object streaming and XML reading.
|
Oh, thanks Y_Less. I think I will give YSI a shot, I have never really thought much about using it.
Quote:
Originally Posted by Joe_
A friend of mine named Kyosaur made a 'MTA MAP LOADER' (Just a snippet on the XML Thread) to load MTA maps, and convert them into SA-MP.
So you could just map the objects, save them (using MTA 1.0 ofcourse), then place them somewhere, and load them with the loader, you'll have to make an array listing every map name, though.
https://sampforum.blast.hk/showthread.php?tid=150755&page=3
It's on the 3rd page, 5 posts down, you'll have to figure out some stuff of your own though.
|
Well, its not really a streamer or a map loader I am looking for, but I will take a look. It may come in handy for the future.
Re: Dynamic Object Arrays -
Яσскѕтая - 21.07.2010
Did you read the streamer functions?
pawn Code:
CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 200.0);
Those are the arguments, you get them on your own..
Re: Dynamic Object Arrays -
Cameltoe - 21.07.2010
I'm also interested in this
Re: Dynamic Object Arrays -
Scenario - 21.07.2010
Quote:
Originally Posted by Яσскѕтая
Did you read the streamer functions?
pawn Code:
CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 200.0);
Those are the arguments, you get them on your own..
|
Yes, I know what the functions are. However, does the array you showed me know what each function is as well? Don't you have to create an "enum", stating what area of the array performs what function with what variable?