Author Topic: Working with Zones  (Read 2035 times)

How do I make an actual Zero Gravity zone? Setting the gravity mod to "0.0" only makes my player fall slowly, instead of float. Here's my code:
Code: [Select]
function Player::GrabZone(%obj)
{
if(%obj.isHanging)
{
%obj.ZoneKill();
%pos = %obj.getPosition();
%pz = new PhysicalZone()
{
velocityMod = "0.0";
gravityMod = "0.0";
gravity = "0.0";
extraDrag = "0.0";
position = %pos;
};
missionCleanup.add(%pz);
%pz.setScale("1 1 3");
talk("new physical zone works");
//this was executed
%obj.pz = %pz;
// %pz.setTransform(%pos);
}
}

I think you need to set the density to the same as the player or so I've heard

I think you need to set the density to the same as the player or so I've heard
awesome, how do I do that? density = 90?

awesome, how do I do that? density = 90?
I have no idea sorry

Maybe do .dump();?

Setting the gravity mod to "0.0" only makes my player fall slowly, instead of float.

probably because your player was already falling down slightly
or that started as you created the zone

do you know how to change zone density?

Here's my updated code:
Code: [Select]
function Player::GrabZone(%obj,%vector)
{
if(%obj.isHanging)
{
%obj.ZoneKill();
%obj.isZoneKilled=0;
%pos = vectorAdd(%obj.getHackPosition(),"0 0 -1");
%pz = new PhysicalZone()
{
velocityMod = "0.0";
gravityMod = "0.0";
extraDrag = "0.0";
isWater = "0";
density = "200";
appliedForce = %vector;
position = %pos;
};
missionCleanup.add(%pz);
%pz.setScale("1 1 5");
// talk("new physical zone works");
%obj.pz = %pz;
}
}
I think the problem is that the player density needs to be the same as the zone density. I do not, however, know how to do this.

Here's my updated code:
Code: [Select]
function Player::GrabZone(%obj,%vector)
{
if(%obj.isHanging)
{
%obj.ZoneKill();
%obj.isZoneKilled=0;
%pos = vectorAdd(%obj.getHackPosition(),"0 0 -1");
%pz = new PhysicalZone()
{
velocityMod = "0.0";
gravityMod = "0.0";
extraDrag = "0.0";
isWater = "0";
density = "200";
appliedForce = %vector;
position = %pos;
};
missionCleanup.add(%pz);
%pz.setScale("1 1 5");
// talk("new physical zone works");
%obj.pz = %pz;
}
}
I think the problem is that the player density needs to be the same as the zone density. I do not, however, know how to do this.
try changing the density variable till it seems right


Have you checked out zonebricks/zone events? It's possible to do with that, so maybe take a look at the code from those.

Have you checked out zonebricks/zone events? It's possible to do with that, so maybe take a look at the code from those.
Yep, that's how I got what I have so far lol.