Please or Register to create posts and topics.

Reflector Sphere?

PreviousPage 2 of 4Next

I'm currently at making a texture. The model's a bit more detailed than my previous models, so I still need to figure out the mapping coordinates before I push ahead. I should have the model ready on Monday.

Sparky the Telus Pig status:
Fully recovered and kicking ham!
Now if only the snow and mud goes away (pigs truly hate wet mud!).
FelixGriffin wrote:
Magnet spheres would be interesting, there's actually a prop entity called phys_magnet that's almost never used in Source.

https://developer.valvesoftware.com/wiki/Phys_magnet

Oh, now THAT is encouraging. It does exactly what I've been wanting to do with magnet boxes. I'll start working on the cube/sphere once our reflector sphere is ready.

I'd be weary of the warning posted at the top of the page. I'll need to experiment with a test model first.

Sparky the Telus Pig status:
Fully recovered and kicking ham!
Now if only the snow and mud goes away (pigs truly hate wet mud!).

Oh, don't worry about that. What it's saying is that if you don't use any model at all, it will crash instead of showing the ERROR model. :) Unfortunately this means there's no way to use a script to ent_create one since it will crash before the script can change its model.

Falsi sumus crusto!

Well, since you need a model for the magnet to work, I have a magnet platform in mind. Too bad cubes don't work the way I want them to. It'll have to be a magnet sphere so that the darn thing doesn't look clumsy when it sticks.

Sparky the Telus Pig status:
Fully recovered and kicking ham!
Now if only the snow and mud goes away (pigs truly hate wet mud!).

And unfortunately I haven't found any way to pick up a magnet. You can only pick up cubes stuck to one.

EDIT: I'm going to be away for a week for spring break, but the script can be as simple as self.SetModel("models/YOUR_MODEL_PATH.mdl"); saved as scripts/vscripts/fg/reflector_sphere.nut (under portal2). Then place a prop_physics of the sphere in your map to load the model, and have a logic_auto make the cubes RunScriptFile fg/reflector_sphere.nut OnMapSpawn.

Falsi sumus crusto!

Regarding changing a model for an entity, I did change the prop_weighted_cube model for a custom one full of new skins in my map Da-MaSK using a simple script. It's more or less as Felix said, I think you could try to use it for the reflector sphere model switch. This was mine:

Code: Select all
function ChangeCubes(){
   Entities.FindByClassname(null, "prop_weighted_cube").SetModel("models/josepezdj/metal_box_jose.mdl");
}

Name it whatever.nut and place it somewhere under scripts/vscripts. You'll need a logic_auto as Felix said altogether with a logic_script entity (in it, you have to set the script name of your script, k?), and fire the output:

OnMapSpawn > [logic_script_name_here] > RunScriptCode > ChangeCubes()

BUT you'll also need to run the script everytime the prop_weighted_cube (with your spehere model) is fizzled, ok? So you'll also have to add the following output in your droppers's cubes:

OnFizzled > [logic_script_name_here] > RunScriptCode > ChangeCubes()

That way it should be working all the time. In the case you already have the sphere model and want me to give it a try taking the chance that I have already built the system, just let me know and send it to me, and if it works I'll post a test map here with the working system, ok? :thumbup:

ImageImageImageImageImageuseful tools and stuff here on TWP :thumbup:
[spoiler]ImageImageImageImageImage[/spoiler]
hailtothedarkside.jpg

Model's ready for action. Going to try the script stuff tomorrow.

gtest_sampe_010000.jpg

gtest_sampe_010001.jpg

The magnet switch's going to be my next model, followed by a glass weight switch (like those bathroom glass scales). I've already sketched some fancy designs, and they won't be as much trouble with UV mapping as this model was.

Shoot! March Break is different here north of the border, isn't it? (CSI Fli-ami got it wrong, big time! As usual...)

Sparky the Telus Pig status:
Fully recovered and kicking ham!
Now if only the snow and mud goes away (pigs truly hate wet mud!).

Looks nice! Let's hope the script works!

Jose: if it's only for specific cubes in this case, a FindByClassnameNearest might be better. And if you do it to the template for the box dropper all the new ones it spawns will have their models changed.

Falsi sumus crusto!
FelixGriffin wrote:
[I]f you do it to the template for the box dropper all the new ones it spawns will have their models changed.

Wait, is it possible to still reach the original template entities? I always thought that all entities referred to by a template were removed from the 'active entities' list and put somewhere where the game doesn't interact with them.
(So that they don't get removed by an EntFire <template_cube>:Kill, for instance.)

Or do you change them before the template picks them up?

Sendificate series: Sendificate | A Beam Too Far | Airtime | 302
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic

I believe either way works--if you select Don't Remove Template Entities you can target the originals.

But the way I did it was to put the script in the Entity Scripts on the template, so it changes on spawn.

Falsi sumus crusto!
PreviousPage 2 of 4Next