Reflector Sphere?
Quote from Naulziator on March 16, 2013, 9:34 amI'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.
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.
Fully recovered and kicking ham!
Now if only the snow and mud goes away (pigs truly hate wet mud!).
Quote from Naulziator on March 16, 2013, 9:39 amFelixGriffin 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.
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.
Fully recovered and kicking ham!
Now if only the snow and mud goes away (pigs truly hate wet mud!).
Quote from FelixGriffin on March 16, 2013, 10:16 amOh, 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.
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.
Quote from Naulziator on March 16, 2013, 10:36 amWell, 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.
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.
Fully recovered and kicking ham!
Now if only the snow and mud goes away (pigs truly hate wet mud!).
Quote from FelixGriffin on March 16, 2013, 12:26 pmAnd 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.
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.

Quote from josepezdj on March 19, 2013, 11:03 amRegarding 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?
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?
Quote from Naulziator on March 19, 2013, 4:49 pmhailtothedarkside.jpgModel's ready for action. Going to try the script stuff tomorrow.
gtest_sampe_010000.jpggtest_sampe_010001.jpgThe 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...)
Model's ready for action. Going to try the script stuff tomorrow.
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...)
Fully recovered and kicking ham!
Now if only the snow and mud goes away (pigs truly hate wet mud!).
Quote from FelixGriffin on March 24, 2013, 7:48 pmLooks 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.
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.
Quote from HMW on March 26, 2013, 2:14 pmFelixGriffin 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?
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?
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic
Quote from FelixGriffin on March 26, 2013, 4:34 pmI 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.
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.