Author Topic: Porting old PortalGun help  (Read 612 times)

Problems:
1) I don't know how to apply textures to the models so I can't make it look blue and orange
2) When you place the blue portal at first, then you shoot down the orange, then you try shooting the blue again to relocate AND the old blue disapears, but the new blue doesn't show up, and then the new blue doesn't apear, and if you try shooting again it wont do anything.

Code
Problem #2:
Code: [Select]
function PortalProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
if(isobject(%obj.client.portalA) && isObject(%obj.client.portalB)){
if(%obj.client.lastportal $= "b") {
%obj.client.portalA.delete();
echo("deleting portal a"); }
else if(%obj.client.lastportal $= "a") {
%obj.client.portalB.delete();
echo("deleting portal b"); }
}
if(isObject(%obj.client.portalA) && !isObject(%obj.client.portalB)){
%pos2 = VectorAdd(%pos, "0 0" SPC 0.2);
%obj.client.portalB = new StaticShape()
{
   position = %pos2;
   datablock = PortalB;
   scale = "2 2 2";
};
%obj.client.portalB.otherportal = %obj.client.portalA;
%obj.client.portalA.otherportal = %obj.client.portalB;
%obj.client.lastportal = "b";
echo("making portal b");
}
else
if(!isObject(%obj.client.portalA) && !isObject(%obj.client.portalB)){
%pos2 = VectorAdd(%pos, "0 0" SPC 0.2);
%obj.client.portalA = new StaticShape()
{
   position = %pos2;
   datablock = PortalA;
   scale = "2 2 2";
};
%obj.client.lastportal = "a";
echo("making portal a");
}
}

Is this the portalgun where it makes a big orange/blue emitter circle?

Is this the portalgun where it makes a big orange/blue emitter circle?
yes, there's no other working one on blockland as far as I know.

Doesn't that one work already though?

You dont have an if statement for if there is a portal b but no portal a.