Ritualistic Forums

Go Back   Ritualistic Forums > Ritual Entertainment Games > Star Trek Elite Force II > EF2 Editing Forum

Reply
 
Thread Tools Display Modes
Old 08-24-2003, 01:30 AM   #1
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default What is needed?

Ok - I want to move a ship from around a corner, into view, stop for 10 seconds, then leave around a corner. In other words, move it from target A to target B - hold 10 sec - then move to target C.

Now, looking at the scripts set in the Attrex. Station, I am having a hard time determining what is and is not needed among them to create such a movement.

I suspect not much is needed, but I simply can't tell the needed from the extra.

Can anyone tell me what few lines in the script are needed for the start, pause, and stop?

Thanx.
6of1 is offline   Reply With Quote
Old 08-24-2003, 01:37 PM   #2
charon
Level Designer
 
Join Date: Apr 2002
Posts: 105
Default Re: What is needed?

Here is one example of how to move the ship. Say your ship is named ship1 and your path is named path1 with each entity in the path being called path1_1 path1_2 path1_3 and so on. This would be one way to get the results you want:

void moveship1()
{
// warp the ship to the first path point and wait for a short time
$ship1.origin( $path1_1.getOrigin() );
wait( .05 );

// move the ship to path1_2
$ship1.moveTo( $path1_2 );
waitfor( $ship1 );

// wait for 10 seconds
wait( 10 );

// move the ship to path1_3
$ship1.moveTo( $path1_3 );
waitfor( $ship1 );
}

At least I believe that should work. I'm trying to remember if moveTo is one of the many commands we used to move objects or not.
charon is offline   Reply With Quote
Old 08-24-2003, 02:00 PM   #3
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: What is needed?

EXCELLENT!

I will try that as soon as I can.

Danke [img]/forums/images/graemlins/smile.gif[/img]
6of1 is offline   Reply With Quote
Old 08-24-2003, 10:32 PM   #4
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: What is needed?

Ok - Ive played around with this all day. I think I have things set properly but I am not getting any movement.

First off, I have the script, similar to the above:

void moveakirasan1()
{

$akirasan1.origin($akira_path1.getOrigin() );
wait( 3 );

$akirasan1.moveTo( $akira_path2 );
waitfor( $akirasan1 );

wait( 5 );

$akirasan1.moveTo( $akira_path3 );

waitfor( $akirasan1 );
}

Then I made the three splinepath nodes. Each has its own targetname (as indicated in the above script). The first and the second also have targets (the node which is next).

Now, I gave the ship the target name 'akirasan1', also as indicated above.

From these settings and the above script I would guess everything is set to go properly. But when I run the map, the model just sits in its starting position. Ive played with multiple variations etc, but am hitting a brick wall. So a few questions:

1. I assume the script (which I called move1 - same name as the map file name) belongs in a separate folder called scripts (in the base folder), correct?

Is that script file supposed to be referenced somewhere in the map? If so, where?

2. I noticed in the attrex map that there is an origin cube sitting halfway into the bounding box of the shuttle ext model. Looking at the entity properties I didnt see how it was linked (if it was at all) to that model. However, I notice that reference is made in the above script to an 'origin'. Does the model of the akirasan1 need an origin entity assigned to it? If so, how does one do that?

Besides these two issues, is there anything else I might have missed which would cause a lack of movement here?
6of1 is offline   Reply With Quote
Old 08-24-2003, 11:05 PM   #5
badman
Sheep Inspector
 
Join Date: Aug 1999
Location: London, UK
Posts: 4,247
Send a message via ICQ to badman Send a message via AIM to badman Send a message via MSN to badman
Default Re: What is needed?

The script file goes in the same folder as the map. It needs to have the same name as the map and its extension must be .scr.
badman is offline   Reply With Quote
Old 08-24-2003, 11:55 PM   #6
BrushBaron
Level Designer
 
Join Date: Sep 2000
Location: Texas
Posts: 1,457
Default Re: What is needed?

You have a function

void moveakirasan1()

make sure you are calling / executing that function somehow.

Easiest way to do that is to add more code like this:


//scripting yay...
void main();
void moveakirasan1();

void main()
{
thread moveakirasan1(); //call the function below to move the model
}

void moveakirasan1()
{
$akirasan1.origin($akira_path1.getOrigin() );
wait( 3 );

$akirasan1.moveTo( $akira_path2 );
waitfor( $akirasan1 );

wait( 5 );

$akirasan1.moveTo( $akira_path3 );

waitfor( $akirasan1 );
}

As for the origin brush, sometimes models will be bound to an origin brush, it make positioning them and moving them around easier.

I think it goes from child to parent so in the script you could write:

$akirasan1.bind($origin);

It's relative to where you positioned everything in the editor. So, place the origin where you want the actual origin to be for the ship model.

After its bound, typically you would script the origin to move around in the level instead and since the origin is a parent... it's child objects such as the model would move with it.

Very confusing, I know... but don't worry about it for now, you should be able to get your model moving without an origin brush/scripting.
BrushBaron is offline   Reply With Quote
Old 08-25-2003, 12:05 AM   #7
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: What is needed?

I made this post at the same time BB made his, so I will try out your suggestion and see what happens.

--

I had tried the script file in a few different folders, including the map folder. It has the same name as the .map and its extention is .scr. So my problem still stands.

I put together my files. If anyone wants to take a look and see if they can tell what I am doing wrong, I would appreciate it:

HERE
6of1 is offline   Reply With Quote
Old 08-25-2003, 01:01 AM   #8
BrushBaron
Level Designer
 
Join Date: Sep 2000
Location: Texas
Posts: 1,457
Default Re: What is needed?

That's not a valid zip file, [img]/forums/images/graemlins/frown.gif[/img]
BrushBaron is offline   Reply With Quote
Old 08-25-2003, 01:02 AM   #9
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: What is needed?

Alright, I tried the above script changes. It did make one difference. When the map starts now, the akirasan1 is in a different position than the first script (it is in the position of akira_path1). However, it still does not budge an inch.

Here is the updated .scr file: UPDATED SCR

Combined with the original files, can anyone tell me what might be preventing movement of the ship?

--

BB - while I understand not needing the origin entity (and grasp the concept of how it apparently works), is an origin entity being referenced in the original script and your update:

$akirasan1.origin($akira_path1.getOrigin() );

or is the above origin referencing something else entirely? (Oh and does it matter that the O in getOrigin is capitalized?)

UPDATE:

BB - Im not sure why you are having probs with the zip file. It was created by windows itself. I can open it with windows and I can also open it on my mac with its zip program as well.

That said - here are the files. Id just give you a directory link but the site doesn't give generic permissions:

http://www.darkproject.org/temp/move1/maps/move1.bsp
http://www.darkproject.org/temp/move1/maps/move1.map
http://www.darkproject.org/temp/move1/maps/move1.prt
http://www.darkproject.org/temp/move1/maps/move1.scr (old one)

and

http://www.darkproject.org/temp/move...e/Akirasan.tik

http://www.darkproject.org/temp/move...ector-glow.dds
http://www.darkproject.org/temp/move...-deflector.dds
http://www.darkproject.org/temp/move...-misc-glow.dds
http://www.darkproject.org/temp/move...akira-misc.dds
http://www.darkproject.org/temp/move...cer-b-glow.dds
http://www.darkproject.org/temp/move...a-saucer-b.dds
http://www.darkproject.org/temp/move...cer-t-glow.dds
http://www.darkproject.org/temp/move...a-saucer-t.dds
http://www.darkproject.org/temp/move...n/Akirasan.tan
6of1 is offline   Reply With Quote
Old 08-25-2003, 02:05 AM   #10
charon
Level Designer
 
Join Date: Apr 2002
Posts: 105
Default Re: What is needed?

It might not be moving because of the command I gave you. I can't remember if thats one of the commands that works or not. I'll have to look when I get into work tommorow.

On the origin stuff. No, you do NOT need an origin brush. An origin brush just reasigns the models origin basically. So when you rotate(or do other movement commands), it will rotate around the origin brush, instead of the model's default origin. The command origin as used in script just warps an object to the origin of another entity. All entities have default origins, so you don't need to specifiy any of them. The getOrigin command just gets the origin of an entity. So basically:

$ship1.origin( $path1_1.getOrigin() );

is just telling ship1 to move its origin on top of path1_1's origin. Again, you DO NOT have to create an origin brush for this to work, as all entities have default origins.
charon is offline   Reply With Quote
Old 08-25-2003, 10:51 AM   #11
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: What is needed?

Thanx.

I appreciate the effort you are putting into this (along with BB and BD).
6of1 is offline   Reply With Quote
Old 08-25-2003, 12:20 PM   #12
BrushBaron
Level Designer
 
Join Date: Sep 2000
Location: Texas
Posts: 1,457
Default Re: What is needed?

http://www.ritualistic.com/games/ef2...ml#ScriptSlave

ton's of move commands and moveTo should be all lowercase, moveto.

BrushBaron is offline   Reply With Quote
Old 08-25-2003, 12:21 PM   #13
charon
Level Designer
 
Join Date: Apr 2002
Posts: 105
Default Re: What is needed?

I remember what the problem is now. The moveto command is correct, but you need to load that model as a script_model and not just a standard model. Otherwise it cannot accept the moveto commands.
charon is offline   Reply With Quote
Old 08-25-2003, 06:14 PM   #14
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: What is needed?

YAH! It moves now! Thank you, Charon, that did it!

Now there is at least one big issue though that I haven't a clue how to resolve:

Though the ship does move, it is not not the only ship on the map. The first is sitting where the model begins and never moves from that spot. The second starts at path1 and moves all the way to path3 as it is supposed to and then stops. Both are visible at all times.

Is there a way to hide the motionless ship (or make it so only the moving ship shows?)
6of1 is offline   Reply With Quote
Old 08-25-2003, 06:53 PM   #15
BrushBaron
Level Designer
 
Join Date: Sep 2000
Location: Texas
Posts: 1,457
Default Re: What is needed?

DAMAN!!! WHERE"S THAT DOCUMENTATIONS!?@$!$!@#$%$^#$&&#$#$@@#$&am p;*#$$##!@%$#%@^!@!@!!

$shit.hide();
BrushBaron is offline   Reply With Quote
Old 08-25-2003, 07:57 PM   #16
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: What is needed?

I can't tell if you are angry with me for asking the question. Its just I have NEVER played with ANY scripting before EVER. As such, having to sift through and guess what script is appropriate for what situation is completely frustrating because - knowing nothing - most of the time any script is unsuccessful. I mean, even with the exact scripts you all were telling me to use, it took a day or more to get simple movement.

Now the hide command is definitely counterintuitive in this instance, since it would suggest the model is not visible at all instead of only hiding the ONE non-moving model. And even knowing a specific script like the one you have mentioned above does not tell me exactly HOW to use it. For instance, do I create its own void thread, and then within the main void call it thread hideakirasan1? Or does it go someplace else? Or is it called something other than a thread in void man?

I ask because when I try the script you name with its own void and thread listing etc, it makes the MOVING model disappear and the NON moving model is still visible. And when I tried it in other ways I could think of, the game failed to compile.

Hopefully you won't yell again simply because I am ignorant of almost everything to do with scripting and therefore my scripts suck. [img]/forums/images/graemlins/frown.gif[/img]
6of1 is offline   Reply With Quote
Old 08-25-2003, 08:40 PM   #17
charon
Level Designer
 
Join Date: Apr 2002
Posts: 105
Default Re: What is needed?

I'm not exactly sure why you have two ships there. Is there any reason you have 2 ships? Are there two ships in radiant stacked on top of each other or with the same targetname?
charon is offline   Reply With Quote
Old 08-25-2003, 09:14 PM   #18
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: What is needed?

Charon

No - there are not two ships in radiant - either apart from or on top of one another. There is only ONE ship - the akirasan1.

The akirasan1 model itself exists off to the right and away from the path (as the shuttle in atrex station does) where I placed it in the .map file. The 'second' akirasan1 exists soley along the spline path, starting at path1 (where no model exists in radient). I believe the 'second' ship is simply an image of the actual akirasan1. That image is created on and follows the splinepath.

The question is: why is the model visible at the same time as the splinepath image of the model (with the side question: why does the hide.akirasan1 script make the image disappear but not the model itself)?
6of1 is offline   Reply With Quote
Old 08-25-2003, 09:47 PM   #19
charon
Level Designer
 
Join Date: Apr 2002
Posts: 105
Default Re: What is needed?

If the effect was not on purpose, then there are two models somewhere then. There are no "images" created when you move objects. Anotherwords, nothing is cloned, copied, or imaged.

Check your entity list and make sure there is not another ship somewhere in the map. The mesh might not show up so you might have to select it through the window.

Also check to make sure none of the path entities or anything else has a model key set with the ship model.
charon is offline   Reply With Quote
Old 08-25-2003, 09:49 PM   #20
BrushBaron
Level Designer
 
Join Date: Sep 2000
Location: Texas
Posts: 1,457
Default Re: What is needed?

I was just fooling around, a bad attempt at humor.

BrushBaron is offline   Reply With Quote
Old 08-25-2003, 09:56 PM   #21
BirdDawg
Experienced
 
Join Date: Jun 2002
Location: Dallas
Posts: 113
Default Re: What is needed?

Do you have any of the spawnflag boxes checked on the model? (ie, does it have a "spawnflags" key?) If it does and it's not "0", it's possible you clicked on MAKE_STATIC, which will make a world-geometry copy of the model. It's useful for props and other static elements. These props become part of the world and won't respond to animation or other script commands.
BirdDawg is offline   Reply With Quote
Old 08-25-2003, 09:57 PM   #22
charon
Level Designer
 
Join Date: Apr 2002
Posts: 105
Default Re: What is needed?

Oh yeah, I forgot all about the make static option. Thats a good one to check.
charon is offline   Reply With Quote
Old 08-25-2003, 10:38 PM   #23
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: What is needed?

BB - Like I said, I couldnt be certain. Im glad it was just humor. [img]/forums/images/graemlins/smile.gif[/img]

Charon - I did a bit of playing around and figured out what the issue was. There were not two ships, nor were any of the path nodes listed with the name of the ship. But I paid close attention to the entity properties and apparently when you had me change the akirasan1 from a vehicle_model to a script_model, the script model added the line: make static = 1. I deleted that line and Poof, the non-moving version of the ship disappeared. [img]/forums/images/graemlins/smile.gif[/img]

--

I am going to play around with the scripting some more, dealing with movement - and so there may yet be a couple more questions on their way. For instance, I copied the path entities for the shuttle in attrex station because I wanted to see how angle and angles would turn the ship. No matter what I do at the moment (without scripts - ie in radient itself) the ship is ALWAYS oriented in the direction the model is oriented, no matter what the spline path entities specify. For instance there can be no angle set and it points the same direction as the angle being set to 90. Or the angles may be set to 0 0 0 and the model points the same way as if the angles are set to -5.0 4128 -5.0 or -5 40 -5 (btw how does one determine what those numbers should be anyway?). I even thought it might be the angle of the ship model itself overriding everything else, but after deleting that I still had no luck. No matter what - even combinations of angle and angles in the spkinepath entities has no effect upon ship orientation.

As I said, I am going to look through some more of the documentation to see if I can find some reference to scripting stuff to make these changes happen (though I am surprised you can make such detailed properties for the splinepath entities and yet they have no impact whatsoever).

Any info you all might have about this would be great. [img]/forums/images/graemlins/smile.gif[/img]

6of1 is offline   Reply With Quote
Old 08-25-2003, 10:40 PM   #24
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: What is needed?

LOL - I was checking and writing as you wrote. Great minds eh? (ok ok your great minds and a coincidence with this muddled mind - heh).
6of1 is offline   Reply With Quote
Old 08-26-2003, 01:18 AM   #25
BrushBaron
Level Designer
 
Join Date: Sep 2000
Location: Texas
Posts: 1,457
Default Re: What is needed?

You can enter garbarge information to any entity and if it doesn't accept it, the entity will igonore it. So the angles / angle for path_nodes probably aren't accepted keys. When I script something I work only on the model I am scripting. If I want to make it turn, I turn the model instead. There are a bunch of rotate commands for scripting. When I am unsure of a new command, I do a find / search in the scripting docs that came with the editor. Then once I find a command that I think will help me, I find a big script from the game and search for that command being used. Then I can see exactly how the syntax is supposed to be, like adding double quotes or single quotes. The syntax is always the hardest for me to remember.
BrushBaron is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:03 PM.


Powered by vBulletin® Version 3.6.3
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.