Portal surface triggering
Quote from FelixGriffin on December 5, 2012, 8:35 amYou can, that's how I did the colorful effects in Multiportal. Those are prop_dynamics tracking the positions of the portals.
You can, that's how I did the colorful effects in Multiportal. Those are prop_dynamics tracking the positions of the portals.
Quote from Fracture on December 5, 2012, 1:16 pmI PLAYED THAT ONE, aw how you do that? i couldn't get it to do that
I PLAYED THAT ONE, aw how you do that? i couldn't get it to do that
Quote from FelixGriffin on December 5, 2012, 5:16 pmI placed two prop_portals in valid positions in a nodraw_portalable box, then used a script to make two prop_dynamics track them.
- Code: Select all
// FelixGriffin's brand new FOUR PORTAL DEVICE! Get it while supplies last!
// Requested by UsCobra11printl("Original Model: "+EntityGroup[0].GetModelName());
printl("Original Model: "+EntityGroup[1].GetModelName());
EntityGroup[0].SetModel("models/effects/fakeportalring_color1.mdl"); //Not really necessary anymore, but it hides them well.
EntityGroup[1].SetModel("models/effects/fakeportalring_color2.mdl");printl("ASHPD4: Models Set!");
function alert(i){
switch(i){
case 1:
printl("ASHPD4: Red Placed!");
EntityGroup[2].SetOrigin(EntityGroup[0].GetOrigin());
local temp = EntityGroup[0].GetAngles();
EntityGroup[2].SetAngles(temp.x+90,temp.y,temp.z);
EntFireByHandle(EntityGroup[2],"Enable","",0,null,null);
break;
case 2:
printl("ASHPD4: Orange Placed!");
break;
case 3:
printl("ASHPD4: Blue Placed!");
break;
case 4:
printl("ASHPD4: Purple Placed!");
EntityGroup[3].SetOrigin(EntityGroup[1].GetOrigin());
local temp = EntityGroup[1].GetAngles();
EntityGroup[3].SetAngles(temp.x+90,temp.y,temp.z);
EntFireByHandle(EntityGroup[3],"Enable","",0,null,null);
}
}Put this in scripts/vscripts/fg/four_portal_gun_start.nut. For the logic_script, EntityGroup 0 and 1 should be the portals, and EntityGroup 2 and 3 the models. The ALERT function places the portals and writes what happened to the console.
It shouldn't be too hard to change for trigger_pushes.
I placed two prop_portals in valid positions in a nodraw_portalable box, then used a script to make two prop_dynamics track them.
- Code: Select all
// FelixGriffin's brand new FOUR PORTAL DEVICE! Get it while supplies last!
// Requested by UsCobra11printl("Original Model: "+EntityGroup[0].GetModelName());
printl("Original Model: "+EntityGroup[1].GetModelName());
EntityGroup[0].SetModel("models/effects/fakeportalring_color1.mdl"); //Not really necessary anymore, but it hides them well.
EntityGroup[1].SetModel("models/effects/fakeportalring_color2.mdl");printl("ASHPD4: Models Set!");
function alert(i){
switch(i){
case 1:
printl("ASHPD4: Red Placed!");
EntityGroup[2].SetOrigin(EntityGroup[0].GetOrigin());
local temp = EntityGroup[0].GetAngles();
EntityGroup[2].SetAngles(temp.x+90,temp.y,temp.z);
EntFireByHandle(EntityGroup[2],"Enable","",0,null,null);
break;
case 2:
printl("ASHPD4: Orange Placed!");
break;
case 3:
printl("ASHPD4: Blue Placed!");
break;
case 4:
printl("ASHPD4: Purple Placed!");
EntityGroup[3].SetOrigin(EntityGroup[1].GetOrigin());
local temp = EntityGroup[1].GetAngles();
EntityGroup[3].SetAngles(temp.x+90,temp.y,temp.z);
EntFireByHandle(EntityGroup[3],"Enable","",0,null,null);
}
}
Put this in scripts/vscripts/fg/four_portal_gun_start.nut. For the logic_script, EntityGroup 0 and 1 should be the portals, and EntityGroup 2 and 3 the models. The ALERT function places the portals and writes what happened to the console.
It shouldn't be too hard to change for trigger_pushes.
Quote from Fracture on December 6, 2012, 12:11 amoh dear god not the scripts. (o_o)
I killed my last computer with scripts. Terrible things happen when I do scripts. Terrible things.
I might save this data for later use
oh dear god not the scripts. (o_o)
I killed my last computer with scripts. Terrible things happen when I do scripts. Terrible things.
I might save this data for later use

Quote from BenVlodgi on December 7, 2012, 10:23 amFelixGriffin wrote:I placed two prop_portals in valid positions in a nodraw_portalable box, then used a script to make two prop_dynamics track them.
- Code: Select all
// FelixGriffin's brand new FOUR PORTAL DEVICE! Get it while supplies last!
// Requested by UsCobra11printl("Original Model: "+EntityGroup[0].GetModelName());
printl("Original Model: "+EntityGroup[1].GetModelName());
EntityGroup[0].SetModel("models/effects/fakeportalring_color1.mdl"); //Not really necessary anymore, but it hides them well.
EntityGroup[1].SetModel("models/effects/fakeportalring_color2.mdl");printl("ASHPD4: Models Set!");
function alert(i){
switch(i){
case 1:
printl("ASHPD4: Red Placed!");
EntityGroup[2].SetOrigin(EntityGroup[0].GetOrigin());
local temp = EntityGroup[0].GetAngles();
EntityGroup[2].SetAngles(temp.x+90,temp.y,temp.z);
EntFireByHandle(EntityGroup[2],"Enable","",0,null,null);
break;
case 2:
printl("ASHPD4: Orange Placed!");
break;
case 3:
printl("ASHPD4: Blue Placed!");
break;
case 4:
printl("ASHPD4: Purple Placed!");
EntityGroup[3].SetOrigin(EntityGroup[1].GetOrigin());
local temp = EntityGroup[1].GetAngles();
EntityGroup[3].SetAngles(temp.x+90,temp.y,temp.z);
EntFireByHandle(EntityGroup[3],"Enable","",0,null,null);
}
}Put this in scripts/vscripts/fg/four_portal_gun_start.nut. For the logic_script, EntityGroup 0 and 1 should be the portals, and EntityGroup 2 and 3 the models. The ALERT function places the portals and writes what happened to the console.
It shouldn't be too hard to change for trigger_pushes.
sexy scripts
- Code: Select all
// FelixGriffin's brand new FOUR PORTAL DEVICE! Get it while supplies last!
// Requested by UsCobra11printl("Original Model: "+EntityGroup[0].GetModelName());
printl("Original Model: "+EntityGroup[1].GetModelName());
EntityGroup[0].SetModel("models/effects/fakeportalring_color1.mdl"); //Not really necessary anymore, but it hides them well.
EntityGroup[1].SetModel("models/effects/fakeportalring_color2.mdl");printl("ASHPD4: Models Set!");
function alert(i){
switch(i){
case 1:
printl("ASHPD4: Red Placed!");
EntityGroup[2].SetOrigin(EntityGroup[0].GetOrigin());
local temp = EntityGroup[0].GetAngles();
EntityGroup[2].SetAngles(temp.x+90,temp.y,temp.z);
EntFireByHandle(EntityGroup[2],"Enable","",0,null,null);
break;
case 2:
printl("ASHPD4: Orange Placed!");
break;
case 3:
printl("ASHPD4: Blue Placed!");
break;
case 4:
printl("ASHPD4: Purple Placed!");
EntityGroup[3].SetOrigin(EntityGroup[1].GetOrigin());
local temp = EntityGroup[1].GetAngles();
EntityGroup[3].SetAngles(temp.x+90,temp.y,temp.z);
EntFireByHandle(EntityGroup[3],"Enable","",0,null,null);
}
}
Put this in scripts/vscripts/fg/four_portal_gun_start.nut. For the logic_script, EntityGroup 0 and 1 should be the portals, and EntityGroup 2 and 3 the models. The ALERT function places the portals and writes what happened to the console.
It shouldn't be too hard to change for trigger_pushes.
sexy scripts