how come this code doesnt get called?
Moderator: InsideQC Admins
5 posts
• Page 1 of 1
how come this code doesnt get called?
- Code: Select all
void() Portal1Touch = {
// Handles touch with Blue portal
local float vel;
local vector org;
local vector oldvel;
local string temp2;
if (portal2_exist==0) return;
if (self.frags>time) return;
vel=vlen(other.velocity) + PORTAL_KICK;
oldvel = other.velocity;
org=portal_clip_player(portal2_entity);
other.origin = org;
other.nextthink1 = other.nextthink;
other.nextthink = time + 0.1;
other.think1 = other.think;
other.think = SUB_teleport;
PortalTeleportEffect(self);
PortalTeleportEffect(portal2_entity);
self.frags = time + PORTAL_REFIRE;
portal2_entity.frags = time + PORTAL_REFIRE;
other.fixangle = 1;
other.velocity = vel * portal2_entity.punchangle * PORTAL_BUFFER;
if ((other.velocity_x == 0) && (other.velocity_y == 0)) {
other.velocity_x = oldvel_x / 2;
other.velocity_y = oldvel_y / 2;
}
other.angles_x = 0;
other.angles_y = vectoyaw(other.velocity);
other.angles_z = 0;
other.v_angle_z = 0;
other.flags = other.flags - other.flags & FL_ONGROUND;
if (other.classname == "invalidwall")
{
PortalErase(portal1_entity);
}
};
void() notwall =
{
self.solid = SOLID_BSP;
self.movetype = MOVETYPE_PUSH;
setorigin (self, self.origin);
setmodel (self, self.model);
self.classname = "invalidwall";
}:
OK, so i tie a wall in worldcraft to notwall (the second function) and then when the portal touches it, PortalErase (portal1_entity); does not execute? why?
- ThePlasticBling
- Posts: 51
- Joined: Fri Jun 04, 2010 10:18 pm
Re: how come this code doesnt get called?
ThePlasticBling wrote:
- Code: Select all
void() Portal1Touch = {
// Handles touch with Blue portal
local float vel;
local vector org;
local vector oldvel;
local string temp2;
if (portal2_exist==0) return;
if (self.frags>time) return;
vel=vlen(other.velocity) + PORTAL_KICK;
oldvel = other.velocity;
org=portal_clip_player(portal2_entity);
other.origin = org;
other.nextthink1 = other.nextthink;
other.nextthink = time + 0.1;
other.think1 = other.think;
other.think = SUB_teleport;
PortalTeleportEffect(self);
PortalTeleportEffect(portal2_entity);
self.frags = time + PORTAL_REFIRE;
portal2_entity.frags = time + PORTAL_REFIRE;
other.fixangle = 1;
other.velocity = vel * portal2_entity.punchangle * PORTAL_BUFFER;
if ((other.velocity_x == 0) && (other.velocity_y == 0)) {
other.velocity_x = oldvel_x / 2;
other.velocity_y = oldvel_y / 2;
}
other.angles_x = 0;
other.angles_y = vectoyaw(other.velocity);
other.angles_z = 0;
other.v_angle_z = 0;
other.flags = other.flags - other.flags & FL_ONGROUND;
if (other.classname == "invalidwall")
{
PortalErase(portal1_entity);
}
};
void() notwall =
{
self.solid = SOLID_BSP;
self.movetype = MOVETYPE_PUSH;
setorigin (self, self.origin);
setmodel (self, self.model);
self.classname = "invalidwall";
}:
OK, so i tie a wall in worldcraft to notwall (the second function) and then when the portal touches it, PortalErase (portal1_entity); does not execute? why?
try replacing
- Code: Select all
if (other.classname == "invalidwall")
{
PortalErase(portal1_entity);
}
with:
- Code: Select all
bprint ("notwall @ ");
bprint (vtos (self.origin));
bprint (" touched by ");
bprint (other.classname);
bprint ("\n");
And see what is printed when they touch each other.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
-

frag.machine - Posts: 2090
- Joined: Sat Nov 25, 2006 1:49 pm
ThePlasticBling wrote:nothing is printed
Are you sure that Portal1Touch() is ever being called ? Is this supposed to be the touch handler for the nowall entity or to the portal entity ?
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
-

frag.machine - Posts: 2090
- Joined: Sat Nov 25, 2006 1:49 pm
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
