| Author |
Topic: Rotating brushes and models at same time... |
| Tally |
General Member Since: Apr 21, 2005 Posts: 819 Last: Oct 26, 2012 [view latest posts] |
|
|
|
Category: CoD4 MP Mapping Posted: Thursday, Mar. 22, 2012 10:51 am |
 |
Rezil writes...Quote: Quote: That isn't true. You can redefine an origin for a script_model as many times as you like, without any problems.
You can redefine an origin, but consequently you'd be moving that script_model to that origin. He wants to rotate the sink using the same pivot as his script_brushmodel.
My interpretation is that he wants to rotate along one of the vertical edges of his brushmodel. If you call a rotate function on both, the brushmodel would rotate using wherever the origin brush is as the pivot while the script_model would rotate along it's own origin point(which, without recompiling the model to my knowledge is impossible to change).
edited on Mar. 22, 2012 02:46 am by Rezil
I don't think you're understanding what is being attempted here, and more importantly HOW it is being attempted. No one is suggesting that a script_model is handled as if it was a brushmodel, thereby confusing different origins and angles between the 2 different entities. In COD, you always have to address each entity with a certain targetname individually by searching for it in a for() loop. You would do it like this:
Code: {
sinkElements = getEntArray( "sink_elements", "targetname" );
if( isDefined( sinkElements ) )
for( i=0; i < sinkElements.size; i++ )
sinkElements[i] rotateYaw( 45, 1.5 );
}
Doing it this way - the "proper" way - would mean no confusion between script_model origins with brushmodel origins.
|
 |
|
|
| Rezil |
General Member Since: Aug 25, 2006 Posts: 30 Last: Apr 10, 2013 [view latest posts] |
|
|
|
|
| HarryNutz |
General Member Since: May 6, 2011 Posts: 182 Last: Mar 26, 2012 [view latest posts] |
|
|
|
|
| Rezil |
General Member Since: Aug 25, 2006 Posts: 30 Last: Apr 10, 2013 [view latest posts] |
|
|
|
Category: CoD4 MP Mapping Posted: Thursday, Mar. 22, 2012 12:30 pm |
 |
HarryNutz writes...Quote: My head is spinning now, lol
All i need is a simple method to move these pieces to allow access to the tunnel under it. It doesn't necessarily have to rotate.
Use Tallys method and report back. |
 |
|
|
| HarryNutz |
General Member Since: May 6, 2011 Posts: 182 Last: Mar 26, 2012 [view latest posts] |
|
|
|
|
| Rezil |
General Member Since: Aug 25, 2006 Posts: 30 Last: Apr 10, 2013 [view latest posts] |
|
|
|
Category: CoD4 MP Mapping Posted: Thursday, Mar. 22, 2012 12:48 pm |
 |
Name your brushmodels and script models that you want to move "sink_element".
Code: main() {
thread rotateSink();
}
rotateSink {
sinkElements = getEntArray( "sink_element", "targetname" );
if( isDefined( sinkElements ) )
for( i=0; i < sinkElements.size; i++ )
sinkElements[i] rotateYaw( 45, 1.5 );
}
Save as your map .gsc. Check whether the sink rotated 45 degrees. |
 |
|
|
| serthy |
General Member Since: Sep 8, 2010 Posts: 482 Last: Jun 28, 2013 [view latest posts] |
|
|
 |
|
Category: CoD4 MP Mapping Posted: Thursday, Mar. 22, 2012 01:59 pm |
 |
okay
if you want to rotate your kitchen-armature, you create some brushes in radiant and make them ALL to ONE script_brushmodel
so you can call your armature with getEnt() > for only 1 single unique object. but you have to rotate your armature AND some xmodels at the same time, so your object consists of different parts, right?
so you have to set for each single object either a script_brushmodel or a script_model in radiant, depending what class it is.
this way getEnt() wont work, because of the different parts, so you have to use getEntArray() - which includes every part of your armature, also you have to call the motion stuff on every single part! this is done by the for-loop, like in Rezils script, every part rotates at the same time.
hope this helps a little |
|
|
|
| HarryNutz |
General Member Since: May 6, 2011 Posts: 182 Last: Mar 26, 2012 [view latest posts] |
|
|
|
Category: CoD4 MP Mapping Posted: Thursday, Mar. 22, 2012 02:59 pm |
 |
Ok so I have all my brushes made into script_brushmodels with targetname of sink_element and then I have each model a script_model also with tagetnames of sink_element....
Now is where some confusion sets in... I already have a mymapname.gsc with:
Code: main()
{
//maps\createart\mp_ag_town_art::main();
maps\mp\_load::main();
maps\mp\_breakglass::main();
maps\mp\mp_ag_town_doors::main();
maps\mp\mp_ag_town_hatches::main();
maps\mp\mp_ag_town_doors_pack::main();
maps\mp\_ac_fan_script::main();
maps\mp\mp_ag_town_drown::main();
maps\createfx\mp_ag_town_fx::main();
maps\mp\mp_ag_town_fx::main();
maps\mp\_explosive_barrels::main();
//maps\mp\_compass::setupMiniMap("compass_map_mp_ag_town");
//setExpFog(500, 2200, 0.81, 0.75, 0.63, 0);
//VisionSetNaked( "mp_ag_town" );
//ambientPlay("ambient_ag_town_ext");
game["allies"] = "marines";
game["axis"] = "opfor";
game["attackers"] = "axis";
game["defenders"] = "allies";
game["allies_soldiertype"] = "desert";
game["axis_soldiertype"] = "desert";
setdvar( "r_specularcolorscale", "1" );
setdvar("r_glowbloomintensity0",".25");
setdvar("r_glowbloomintensity1",".25");
setdvar("r_glowskybleedintensity0",".3");
setdvar("compassmaxrange","1800");
}
And why do I feel like something is missing... what exactly is going to make this rotate? Don't I need a trigger/s? |
 |
|
|
| Rezil |
General Member Since: Aug 25, 2006 Posts: 30 Last: Apr 10, 2013 [view latest posts] |
|
|
|
|
| HarryNutz |
General Member Since: May 6, 2011 Posts: 182 Last: Mar 26, 2012 [view latest posts] |
|
|
|
|
|
|
mp_TempleCall of Duty: Mods: Multiplayer (624.12Kb)
|