Jump to content

Moving/rotating several entities/origins


Recommended Posts

Posted

I'm making a boat, big enough for about 2 people to be in. I was wondering if there's any way to move and rotate a group of objects consisting of several entities, OR with several origins. Here's an example of what I'm facing:

 

A boat (func_static) with doors that can rotate open. This requires one origin for the movement of the boat, and two different origins for the doors to rotate with. If I was to move this boat with a script and even rotate it, the doors wouldn't be part of the same func_static, thus have different origins and not rotate around the correct origin when the whole boat moves.

 

 

Is there a way to do something like... setting a set of targetnames to be the children of a parent entity with one origin, to manage them all in situations like that? Or any other ways around it?

Posted

mmm, idea little stupid but... try to connect the boat to the doors with ctrl + k select the boat, and a door, and ctrl + k, do the same with other door. I hope that in that' mode , because doors become childrens of the boat, they are affected by the same movement.

i ask a question about a similiar issue: is possible toi create map_object that can be moved by force push, or script?

people has told me yes is possible: need simply to create a entity that can be affected by movement or push, like a physic clip textures entity around the map_object and link the map objkect to the enity phisitc clip. remember the korriban map? yu pushed 4 statues for open a stair that lead into the catacomb of marka ragnos tomb. is the first puzzle in the map kor1.

i suppose that studying how work thats force pushing md3 statue can give you the solustion for your problem with the boat.

:)

Posted

It actually sounds like it could work, but I tried it and the boat does not move its targets along with itself.

mmmm... i not know if is possible, but... can you do the 3 entities like a func_group? do a back up of the map. and after you program the movement of all group.

 

func group description: Used to group brushes together just for editor convenience.  They are turned into normal brushes by the utilities.

 

q3map_onlyvertexlighting 1    =    brush only gets vertex lighting (reduces bsp size!)

Posted

You can move brushes with ref_tags via script. As to your rotating issue, I don't think there is a solid way to do it unless you can affect all entities within a group. Afaik, groups are for ease of use in the editor and have no real function.

Posted

mmm... I think we get the problem by the wrong way. I have an idea:

and if Gnur create an entity a part, maybe a ref_Tag and connect with CTRL - K the entity to the boat and the door? and their so are all children of the entity? And so, the movement of Ref tag can move together boat and door in the same direction.

mmm i not know if work, is just a theory.

But if work for kor1 statues for the puzzle push of the upper chamberr of the catacombs (is pushed an invisible enetity that move the md3. model of statue with script) maybe can work also for your boat.

Posted
Thanks for the highlight, seems I wasn't following this forum yet.

 

This is a big problem. Jedi Academy can't really do it. The possibly best way to kind of do it would be a ROFF animation, i.e. use some external program to animate the movement, then export that into Jedi Academy. But it will likely go out of sync if one of the parts is blocked and there's not really anything that can be done about that, I believe.

Posted

You might be able to use some form of get or set origin to take the current ingame origin of the doors and rotate from there instead of around a pre-set point.

Sounds appealing, but I'm imagining things like... it will get the origin of its centered self (thus rotating the door not around the hinges) while the boat is moving, and even if it's possible to rotate around this origin, this origin would stay behind after it was gotten, and the doors would rotate out of the boat.

 

It did give me another sliiightly possible idea though, where I'd need 2 entities placed where the hinges of the door should be, moving towards 2 different ref_tags placed accordingly with the ref_tag of the boat itself, so that they would always be lined up. This is hard to position when rotating the boat, I think. Then I would get the origin of those two entities and copy it to my own doors. I doubt however that it will constantly get the origin (which is moving) instead of getting it when the script runs and then forgetting about it.

 

 

This is a big problem. Jedi Academy can't really do it. The possibly best way to kind of do it would be a ROFF animation, i.e. use some external program to animate the movement, then export that into Jedi Academy. But it will likely go out of sync if one of the parts is blocked and there's not really anything that can be done about that, I believe.

Are ROFFs supported for multiplayer (type OpenJK/JKG possibly), let alone the existence of exporters for it? (seem to remember a temporarily unresolved thread concerning this)

Posted

Hmmm I'm getting close to a potential solution. I have achieved to move the doors in alignment with the boat and rotate them when pressing another trigger. Without any of the things I considered above. It only uses scripts, its own origins and waypoints that it travels to.

 

I have to sleep now, but I'll continue tomorrow. I'll let you know what I did and how it works so far:

 

 

 

Boat's parm1 is 0 at level start.

Script number 1 says:

_______________________________________________

 

if parm1 is 0, then set it to 1 and do this task:

move "boat" to tag1

move "left door" to tag2

move "right door" to tag3

move "trigger that starts the boat" to tag1 (resized to align origin of "boat")

move "trigger that opens doors" to tag4.

 

// doortrigger's parm1 is set to 0 at level start

if "trigger that opens doors" parm1 is 1, then

rotate "left door" 0 90 0

rotate "right door" 0 -90 0

________________________________________ //Script number 2:

 

The trigger that opens the doors points to a different script that simply sets the trigger's parm1 to 1. (I would however like to somehow do this in the first script - suggestions very welcome).

_____________________________________________________________

 

So the first script never reaches the second if-statement unless you press the door-trigger and run the second script, which sets parm1 to 1.

 

 

 

 

I still don't know if I'm gonna get around the issue of potentially rotating the whole boat.

NOTE: Blocking the doors get them out of sync. So it probably has to be a one-shot that opens out-wards, if the player starts inside the boat's control room.

 

 

Real behaved code, for those who want that instead:

 

 

//Generated by BehavEd


rem ( "comment" );


affect ( "boat", /*@AFFECT_TYPE*/ FLUSH )
{


if ( $get( FLOAT, "SET_PARM1")$, $=$, $0$ )
{
set ( /*@SET_TYPES*/ "SET_PARM1", "1" );


task ( "moveboatanddoors" )
{
move ( $tag( "boatpos2", ORIGIN)$, < 0.000 0.000 0.000 >, 14000.000 );


affect ( "boatdoor_left", /*@AFFECT_TYPE*/ FLUSH )
{
move ( $tag( "boatpos_Ldoor2", ORIGIN)$, < 0.000 0.000 0.000 >, 14000.000 );


affect ( "boatdoor_right", /*@AFFECT_TYPE*/ FLUSH )
{
move ( $tag( "boatpos_Rdoor2", ORIGIN)$, < 0.000 0.000 0.000 >, 14000.000 );


affect ( "trigger_startboat", /*@AFFECT_TYPE*/ FLUSH )
{
move ( $tag( "boatpos2", ORIGIN)$, < 0.000 0.000 0.000 >, 14000.000 );


affect ( "trigger_boatdoors", /*@AFFECT_TYPE*/ FLUSH )
{
move ( $tag( "boat_doortriggerpos2", ORIGIN)$, < 0.000 0.000 0.000 >, 14000.000 );
}


}


}


}


}


dowait ( "moveboatanddoors" );
flush (  );
}


}




affect ( "trigger_boatdoors", /*@AFFECT_TYPE*/ FLUSH )
{


if ( $get( FLOAT, "SET_PARM1")$, $=$, $1$ )
{


affect ( "boatdoor_left", /*@AFFECT_TYPE*/ FLUSH )
{
rotate ( < 0.000 90.000 0.000 >, 1000.000 );


affect ( "boatdoor_right", /*@AFFECT_TYPE*/ FLUSH )
{
rotate ( < 0.000 -90.000 0.000 >, 1000.000 );
}


}


}


}
//Generated by BehavEd

rem ( "comment" );

affect ( "trigger_boatdoors", /*@AFFECT_TYPE*/ FLUSH )
{
	set ( /*@SET_TYPES*/ "SET_PARM1", "1" );
}

 

 

Asgarath83 likes this
Posted

Are ROFFs supported for multiplayer (type OpenJK/JKG possibly), let alone the existence of exporters for it? (seem to remember a temporarily unresolved thread concerning this)

I'm not entirely sure about multiplayer, but I do think so (the boulder in t3_rift can be pushed in mp, right?). As for the exporter, the WIP one is for 3DS Max - there's a working one for Blender.
Posted

I'm not entirely sure about multiplayer, but I do think so (the boulder in t3_rift can be pushed in mp, right?). As for the exporter, the WIP one is for 3DS Max - there's a working one for Blender.

 

Yeah it can be pushed.

Posted

Haha yeah, wish it was that easy :D

Is not so madness as thing. O.o but yes, is an idea. if the boat make a jorney in a river, yu can make something like the t1_rail map. remenbers? the roofs of palace repeating forever their path. i have edit that's map for my mod some years ago, and for what i see, was very funny XD basically the all palaces go in a loop scripted train around the train. when yu play t1_rail, yu got the illusion of train do a race into the city. in really, the train not move. is the city that's moving. You can try something like that, maybe :) but in that case, yu need to make all your level into a boat race in a river or into the sea. :D

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...