Reflector Sphere?

Avatar
Naulziator
104 Posts
Posted Mar 13, 2013
Has anyone tried this idea? If so, where can I find one?
Advertisement
Registered users don’t see ads! Register now!
Avatar
taco
504 Posts
Posted Mar 13, 2013
Replied 4 minutes later
If the idea is putting two words beside each other and then not explaining what you are talking about, then yes - many people have tried that before.
Avatar
josepezdj
2,386 Posts
Posted Mar 13, 2013
Replied 2 minutes later

Naulziator wrote:
Has anyone tried this idea? If so, where can I find one?

What for? maybe to make it roll redirecting the laser to different laser_catchers placed in different locations but aligned in a row? :biggrin: .. Ha, no, I guess it would be more interesting that you can simply get a wider range of angles to redirect the laser from a given position or when settled in the ball_button

I think it could be difficult to create without scripting. But definitely interesting :thumbup:

Avatar
Naulziator
104 Posts
Posted Mar 13, 2013
Replied 2 hours later
It'd be cool to try, as the rolling ball would eliminate cheap ways out of a few puzzles we've checked out, such as Chambre 21 in Portal 2. We'd need to create a pedestal for it, though, to enforce a specific location without using a button.

I can create the pedestal & ball in Blender if someone else can help me with the coding.

Avatar
FelixGriffin
2,680 Posts
Posted Mar 13, 2013
Replied 2 hours later
If you add the proper attachments to the sphere model it's fairly straightforward to SetModel a laser cube to it. I've never tried it with laser cubes, but I think it will work.
Avatar
josepezdj
2,386 Posts
Posted Mar 14, 2013
Replied 10 hours later

FelixGriffin wrote:
If you add the proper attachments to the sphere model it's fairly straightforward to SetModel a laser cube to it.

That simple? hmmmm... sounds very interesting, deserves a try! :thumbup:

Avatar
protoborg
288 Posts
Posted Mar 14, 2013
Replied 14 hours later

taco wrote:
If the idea is putting two words beside each other and then not explaining what you are talking about, then yes - many people have tried that before.

You don't have to be nasty about it. The OP was perhaps a bit sparse on words, but it was obviously enough for other people to understand what Naulziator was getting at. You could be more kind with your criticisms in the future. At the very least, you could have asked for clarification.

Avatar
Naulziator
104 Posts
Posted Mar 15, 2013
Replied 16 hours later
'kay! I think I have a decent design in mind. Also, I have some design ideas for a 'bomb' sphere, magnetic sphere & magnetic cube.

Judging from all that coding, I think I'll stick to just the model and texture design for now. Work and PS3 need to have a fair balance for me at this time.

Avatar
Naulziator
104 Posts
Posted Mar 15, 2013
Replied 40 minutes later
Yeah, you guys are going to like this. It's going to be like the reflector glass from the cube, but with a simple skeletal 'spherical' frame. Binding the skeleton frame is going to take a little time...
Avatar
FelixGriffin
2,680 Posts
Posted Mar 15, 2013
Replied 5 hours later
If you make a simple model with the attachment for now I'll give you a script to test it with, I want to see if this works.

Magnet spheres would be interesting, there's actually a prop entity called phys_magnet that's almost never used in Source.

Avatar
Naulziator
104 Posts
Posted Mar 16, 2013
Replied 15 hours later
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.
Avatar
Naulziator
104 Posts
Posted Mar 16, 2013
Replied 5 minutes later

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.

Avatar
FelixGriffin
2,680 Posts
Posted Mar 16, 2013
Replied 36 minutes later
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. :smile: 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.
Avatar
Naulziator
104 Posts
Posted Mar 16, 2013
Replied 19 minutes later
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.
Avatar
FelixGriffin
2,680 Posts
Posted Mar 16, 2013
Replied 1 hour later
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.

Avatar
josepezdj
2,386 Posts
Posted Mar 19, 2013
Replied 2 days later
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:

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:

Avatar
Naulziator
104 Posts
Posted Mar 19, 2013
Replied 5 hours later
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...)

Avatar
FelixGriffin
2,680 Posts
Posted Mar 24, 2013
Replied 5 days later
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.

Avatar
HMW
806 Posts
Posted Mar 26, 2013
Replied 1 day later

FelixGriffin wrote:
*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 :Kill, for instance.)

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

Advertisement
Registered users don’t see ads! Register now!
Avatar
FelixGriffin
2,680 Posts
Posted Mar 26, 2013
Replied 2 hours later
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.