Blockland Forums > Modification Help
static map spawn??
datiel12:
--- Quote from: PhantOS on February 27, 2018, 04:55:44 PM ---Put an announce(); inside each layer of brackets. Put some random text for each announce. Post updated code + chat feed
--- End quote ---
Like this?
--- Code: ---package LoadMapPackage
{
function GameConnection::startLoad(%client)
announce("ahs");
{
if(!isObject("MapGroup"))
announce("fhs");
{
exec("Add-Ons/Map_Neon_Room/place.cs");
MissionCleanup.add("MapGroup");
announce("ahs");
if(isObject(PlayerDropPoints))
{
announce("ahs");
if(isObject(%obj = PlayerDropPoints.getObject(0)))
{
announce("ahs");
%obj.setTransform("21 4 3 1 0 0 0");
%obj.setScale("0.940827 1.97505 1");
}
}
}
Parent::startLoad(%client);
}
};
--- End code ---
Never actually did anything like this..
PhantOS:
Yes but after each bracket. What you did there will give errors. Do this
Function blah
{
Announce stuff
More stuff
}
Also make each announce say something different. Like numbers 1, 2, 3 etc
PhantOS:
It's called debugging. Make sure you post what the chat says so we know how far we get into the functions before it cancels
datiel12:
--- Quote from: PhantOS on February 27, 2018, 06:26:19 PM ---It's called debugging. Make sure you post what the chat says so we know how far we get into the functions before it cancels
--- End quote ---
Okay, I did it
--- Code: ---package LoadMapPackage
{
function GameConnection::startLoad(%client)
{
announce("egg ");
if(!isObject("MapGroup"))
{
announce("3 ");
exec("Add-Ons/Map_Neon_Room/place.cs");
MissionCleanup.add("MapGroup");
if(isObject(PlayerDropPoints))
{
announce("99 ");
if(isObject(%obj = PlayerDropPoints.getObject(0)))
{
announce("32 ");
%obj.setTransform("21 4 3 1 0 0 0");
%obj.setScale("0.940827 1.97505 1");
}
}
}
Parent::startLoad(%client);
}
};
--- End code ---
and
It ran all the way through, I think it might be the transform position..
PhantOS:
Yeah so all the code checks out. You can remove the debug stff
If you want to get a good transform, move your player to where you want your spawn to be, go to console and type announce(findclientbyname(yourname).player.getTransform()); and put that number in the code