Portal surface triggering

Avatar
FelixGriffin
2,680 Posts
Posted Dec 05, 2012
Replied 3 hours later
You can, that's how I did the colorful effects in Multiportal. Those are prop_dynamics tracking the positions of the portals.
Advertisement
Registered users don’t see ads! Register now!
Avatar
Fracture
797 Posts
Posted Dec 05, 2012
Replied 4 hours later
I PLAYED THAT ONE, aw how you do that? i couldn't get it to do that
Avatar
FelixGriffin
2,680 Posts
Posted Dec 05, 2012
Replied 3 hours later
I placed two prop_portals in valid positions in a nodraw_portalable box, then used a script to make two prop_dynamics track them.

// FelixGriffin's brand new FOUR PORTAL DEVICE! Get it while supplies last!
// Requested by UsCobra11

printl("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.

Avatar
Fracture
797 Posts
Posted Dec 06, 2012
Replied 6 hours later
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

Avatar
BenVlodgi
633 Posts
Posted Dec 07, 2012
Replied 1 day later

FelixGriffin 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.

```
// FelixGriffin's brand new FOUR PORTAL DEVICE! Get it while supplies last!
// Requested by UsCobra11

printl("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 :thumbup:

Advertisement
Registered users don’t see ads! Register now!
Avatar
Fracture
797 Posts
Posted Dec 07, 2012
Replied 5 hours later
..... ?_?

I'm going to ignore that last bit