Author Topic: static map spawn??  (Read 4215 times)

So, I finished a map and when I load the addon I don't spawn in the map but I spawn ontop of it.. How I fix????????


thank  :cookie:

you need to be more specific. are you using a framework for this?

you need to be more specific. are you using a framework for this?
Framework? I just made a map in blender and exported it using Tendons export.py.

I tried using the same code from the Kitchen BL map but it didn't work

Code: [Select]
package LoadMapPackage
{
function GameConnection::startLoad(%client)
{
if(!isObject("MapGroup"))
{
exec("Add-Ons/Map_Neon_Room/place.cs");
MissionCleanup.add("MapGroup");
                        if(isObject(PlayerDropPoints))
{
if(isObject(%obj = PlayerDropPoints.getObject(0)))
{
%obj.setTransform("21 4 3 1 0 0 0");
    %obj.setScale("0.940827 1.97505 1");
}
}
}   
Parent::startLoad(%client);
}
};

I tried it this way cause it looks exactly like the spawn code in Map_Kitchen

Put an announce(); inside each layer of brackets. Put some random text for each announce. Post updated code + chat feed

Put an announce(); inside each layer of brackets. Put some random text for each announce. Post updated code + chat feed
Like this?

Code: [Select]
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);
}
};

Never actually did anything like this..

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

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

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

Okay, I did it

Code: [Select]
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);
}
};

and



It ran all the way through, I think it might be the transform position..

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

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
Thats what i did the first time, thats where the parameters came from in this line

Code: [Select]

%obj.setTransform("21 4 3 1 0 0 0");
%obj.setScale("0.940827 1.97505 1");
}


Why is the scale weird?

Why is the scale weird?

im not sure what the scale does, i just saw it in the kitchen code

I just added new coordinates, it spawns me closer but still on top of the map, it just wont work
« Last Edit: February 27, 2018, 06:49:24 PM by datiel12 »