StaffSaberist Posted October 23, 2005 Author Share Posted October 23, 2005 OK, I found the JA scripts .zip file. Wow! The navigation is a wee bit longer than I figured. OK, I'm gonna try out a few things, be back soon. Edit- what is wrong now? //Generated by BehavEd rem ( "Opening" ); camera ( /*@CAMERA_COMMANDS*/ ENABLE ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam1", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam1", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); affect ( "SceneJedi", FLUSH ) { set ( "SET_BEHAVIORSTATE", "BS_DEFAULT" ); set ( "SET_WALKING", "true" ); task ( "Walk to t2" ) { set ( /*@SET_TYPES*/ "SET_NAVGOAL", $get( STRING, "SET_t2")$ ); } do ( "Walk to t2" ); task ( "Walk to t3" ) { set ( /*@SET_TYPES*/ "SET_NAVGOAL", $get( STRING, "SET_t3")$ ); } do ( "Walk to t3" ); task ( "Walk to t4" ) { set ( /*@SET_TYPES*/ "SET_NAVGOAL", $get( STRING, "SET_t4")$ ); } do ( "Walk to t4" ); } wait ( 8000.000 ); rem ( "From Camera I to Camera II" ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam2", ORIGIN)$, $5000$ ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam2", ANGLES)$, < 0.000 0.000 0.000 >, 5000 ); wait ( 7000.000 ); rem ( "From II to III" ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam3", ORIGIN)$, 5000 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam3", ANGLES)$, < 0.000 0.000 0.000 >, 5000 ); camera ( /*@CAMERA_COMMANDS*/ ZOOM, 30.000, 3000 ); wait ( 8000.000 ); camera ( /*@CAMERA_COMMANDS*/ DISABLE ); Link to comment Share on other sites More sharing options...
lukeskywalker1 Posted October 23, 2005 Share Posted October 23, 2005 Well, your telling it to do all those tasks at the same time! Either put some waits between them or use "dowait" Like this: //(BHVD) affect ( "SceneJedi", FLUSH ) { set ( "SET_BEHAVIORSTATE", "BS_DEFAULT" ); set ( "SET_WALKING", "true" ); task ( "Walk to t2" ) { set ( /*@SET_TYPES*/ "SET_NAVGOAL", $get( STRING, "SET_t2")$ ); } do ( "Walk to t2" ); wait ( 5000.000 ); task ( "Walk to t3" ) { set ( /*@SET_TYPES*/ "SET_NAVGOAL", $get( STRING, "SET_t3")$ ); } do ( "Walk to t3" ); wait ( 5000.000 ); task ( "Walk to t4" ) { set ( /*@SET_TYPES*/ "SET_NAVGOAL", $get( STRING, "SET_t4")$ ); } do ( "Walk to t4" ); } As for dowaits, im not sure if they would work well, so I never bothered with them. EDIT: also, I wonder if the behavior state has something to do with the NPCs not walking? Link to comment Share on other sites More sharing options...
lassev Posted October 23, 2005 Share Posted October 23, 2005 set ( /*@SET_TYPES*/ "SET_NAVGOAL", [color=Red]$get( STRING, "SET_t2")$ )[/color]; I hope you have declared and given the variable SET_t2 a proper value prior to launching this script. You never answered that question, when I first time asked... And like shukrallah pretty much said, it's not very wise to use bs_default in cinematics. Bs_cinematic wasn't invented just for extra kicks but to prevent any unpredictable things happening. In BS_default, the NPCs have full AI support, and they can do all kinds of things you were never able to foresee. Link to comment Share on other sites More sharing options...
StaffSaberist Posted October 23, 2005 Author Share Posted October 23, 2005 That's a variable? Oh, geez. I am trying to get this guy to go to a ref_tag on the map with the targetname "t2". Then, to walk to a ref_tag with targetname "t3" and so on. So, I would declare a variable, of whatever name I wanted, as "t2"? Sorry I didn't answer. I thought you meant to ask that in a mildly sarcastic way, like, "If you do it this way you need a variable". That got me thinking there was another way... OK. I'll have a better look-see at the declare section of the ICARUS manual. Link to comment Share on other sites More sharing options...
lukeskywalker1 Posted October 24, 2005 Share Posted October 24, 2005 Use waypoint_navgoal instead of a ref_tag. Give it a targetname t2. Link to comment Share on other sites More sharing options...
StaffSaberist Posted October 24, 2005 Author Share Posted October 24, 2005 So, it would look like this: set ( "waypoint_navgoal", "t2" ) correct? Link to comment Share on other sites More sharing options...
lukeskywalker1 Posted October 24, 2005 Share Posted October 24, 2005 set ( /*@SET_TYPES*/ "SET_NAVGOAL", "t2" ); I was saying in the editor use nav_goals instead of ref_tags Link to comment Share on other sites More sharing options...
StaffSaberist Posted October 24, 2005 Author Share Posted October 24, 2005 OK, I'll get to that in a bit. Though, is ref_tag really all that different? It is just an entity... don't answer that one, I'm gonna find out. Link to comment Share on other sites More sharing options...
lukeskywalker1 Posted October 24, 2005 Share Posted October 24, 2005 Im not sure, but I figured it was worth a try... I always used navgoals because thats what they are for. Reftags work for things like cameras.... so... crap it might work. But then again the script actually calls for navgoals (SET_NAVGOAL) so... yeah, play with it a bit and see what happens... Link to comment Share on other sites More sharing options...
lassev Posted October 24, 2005 Share Posted October 24, 2005 Use navgoals. Like shukrallah said (what kind of name is this anyway, your old one was better, man, this is impossible to remember...), that's what navgoals are for. I wouldn't personally even know at what height you should place a ref_tag, even if it worked. Navgoal can be placed normally so that it touches the floor just like NPC_spawners themselves. But a ref_tag..? Who knows, even if it worked, which I doubt. And even if it was half sarcastic, it still contained the info, eh? You can store the navgoal info (name) also in entity parms or variables, and then it would be close to the method you used. Sometimes that can be very useful. Link to comment Share on other sites More sharing options...
StaffSaberist Posted October 24, 2005 Author Share Posted October 24, 2005 And even if it was half sarcastic, it still contained the info, eh? Eh. Yeah, OK, I will. But first, I want to solve a very irritating problem I'm having in SwKotor I. Thinking about burning that game... what kind of name is this anyway, your old one was better, man, this is impossible to remember.. Gotta agree, shukrallah. Sorry, maybe if we knew what that name meant, we'd think of it as normal. But Lukeskywalker1 was Star Wars oriented, man! Link to comment Share on other sites More sharing options...
lukeskywalker1 Posted October 24, 2005 Share Posted October 24, 2005 Lol, I actually laughed when reading that. Its actually arabic... "shukra allah" (or some sort of spelling) means thanks to God. Im 50% lebanese, and it happens to be my last name (its christian) IDK, the lukeskywalker1 thing sorta got old... im not as big of a star wars fan as I once was. Eh. Yeah, OK, I will. But first, I want to solve a very irritating problem I'm having in SwKotor I. Thinking about burning that game... You mod KOTOR as well? Or are you just having tech problems? Link to comment Share on other sites More sharing options...
StaffSaberist Posted October 24, 2005 Author Share Posted October 24, 2005 I'm having tech problems with that game, where I have a severe framerate issue in one place. Anyway, the thread is in the Workbench under the thread title "After upgrading, I can't play SwKotor". So far, I've reinstalled twice, to no avail. I probably need a different brand of video card. Anyway, since there are no replies there yet, I'm gonna get to work on scripting. Link to comment Share on other sites More sharing options...
StaffSaberist Posted October 24, 2005 Author Share Posted October 24, 2005 Okay, it doesn't work, and I may know why. I know I need to define the navgoal entities, but I am unsure as to how. Would that be the declare function? Because that's how vB does it. I am unsure. Although I left the rems and the tasknames the same, I changed the navgoals to navgoal entities, marked Test1, Test2, and Test3. I also have changed the wait... thingies... to the kind I used before, having the script wait intil "walk to t2" is done, etc. //Generated by BehavEd rem ( "Opening" ); camera ( /*@CAMERA_COMMANDS*/ ENABLE ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam1", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam1", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); affect ( "SceneJedi", FLUSH ) { set ( "SET_BEHAVIORSTATE", "BS_DEFAULT" ); set ( "SET_WALKING", "true" ); task ( "Walk to t2" ) { set ( /*@SET_TYPES*/ "SET_NAVGOAL", "Test1" ); do ( "Walk to t2" ); task ( "Walk to t3" ) { set ( /*@SET_TYPES*/ "SET_NAVGOAL", "Test2" ); do ( "Walk to t3" ); task ( "Walk to t4" ) { set ( /*@SET_TYPES*/ "SET_NAVGOAL", "Test3" ); do ( "Walk to t4" ); } wait ( "Walk to t2" ); rem ( "From Camera I to Camera II" ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam2", ORIGIN)$, $5000$ ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam2", ANGLES)$, < 0.000 0.000 0.000 >, 5000 ); wait ( "Walk to t3" ); rem ( "From II to III" ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam3", ORIGIN)$, 5000 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam3", ANGLES)$, < 0.000 0.000 0.000 >, 5000 ); camera ( /*@CAMERA_COMMANDS*/ ZOOM, 30.000, 3000 ); wait ( "Walk to t4" ); camera ( /*@CAMERA_COMMANDS*/ DISABLE ); } } } Link to comment Share on other sites More sharing options...
lassev Posted October 25, 2005 Share Posted October 25, 2005 You have a structural problem now. Don't place the DO inside a task, and don't place tasks inside other tasks. But your set_navgoal commands look good now. You just enter a targetname in the properties of a navgoal in Radiant, and then type that targetname straight in the set_navgoal command. It looks like you have done that. That's the simplest and most common way of using navgoals, and nothing else is needed. Usually scripts (or let's say individual affects as tasks are affect specific and there can be more than one affect per script) are built so that you have all the tasks in the beginning, one after another (but not inside each other), and then at proper place and time you DO (or DOWAIT) those tasks later in the script. That way you can quickly scan all the tasks later on if needed. However, it doesn't really matter technically as long as the task is defined before the DO command. So, reparse your script so that you have a few tasks that contain nothing but the set_navgoal command belonging to that particular task. And after those tasks have the rest of the script, including the DOs and camera commands and waits and stuff. Link to comment Share on other sites More sharing options...
StaffSaberist Posted October 25, 2005 Author Share Posted October 25, 2005 Now the cutscene fails to load at all. It skips right to the game. //Generated by BehavEd rem ( "Opening" ); camera ( /*@CAMERA_COMMANDS*/ ENABLE ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam1", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam1", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); affect ( "SceneJedi", FLUSH ) { set ( "SET_BEHAVIORSTATE", "BS_CINEMATIC" ); set ( "SET_WALKING", "true" ); } task ( "Walk to t2" ) { set ( /*@SET_TYPES*/ "SET_NAVGOAL", "Test1" ); } do ( "Walk to t2" ); task ( "Walk to t3" ) { set ( /*@SET_TYPES*/ "SET_NAVGOAL", "Test2" ); } do ( "Walk to t3" ); task ( "Walk to t4" ) { set ( /*@SET_TYPES*/ "SET_NAVGOAL", "Test3" ); } do ( "Walk to t4" ); wait ( "Walk to t2" ); rem ( "From Camera I to Camera II" ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam2", ORIGIN)$, $5000$ ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam2", ANGLES)$, < 0.000 0.000 0.000 >, 5000 ); wait ( "Walk to t3" ); rem ( "From II to III" ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam3", ORIGIN)$, 5000 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam3", ANGLES)$, < 0.000 0.000 0.000 >, 5000 ); camera ( /*@CAMERA_COMMANDS*/ ZOOM, 30.000, 3000 ); wait ( "Walk to t4" ); camera ( /*@CAMERA_COMMANDS*/ DISABLE ); Link to comment Share on other sites More sharing options...
lassev Posted October 25, 2005 Share Posted October 25, 2005 Uhhuh. Your tasks and other commands aren't anymore inside the Affect. You gotta be more careful and meticulous with the code. Link to comment Share on other sites More sharing options...
lukeskywalker1 Posted October 26, 2005 Share Posted October 26, 2005 Thats why I use behaved... Whats wrong with BehavEd anyways? Its so much easier than notepad. Link to comment Share on other sites More sharing options...
StaffSaberist Posted October 26, 2005 Author Share Posted October 26, 2005 I do use Behaved. Look at the first line: //Generated by BehavEd. I use notepad to rearrange the commands a bit easier. Just gotta be a bit more careful about how, no? Do I have to say it now? What... did... I... screw... up... on... this... time??? //Generated by BehavEd rem ( "Opening" ); camera ( /*@CAMERA_COMMANDS*/ ENABLE ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam1", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam1", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); affect ( "SceneJedi", FLUSH ) { set ( "SET_BEHAVIORSTATE", "BS_CINEMATIC" ); set ( "SET_WALKING", "true" ); task ( "Walk to t2" ) { set ( /*@SET_TYPES*/ "SET_NAVGOAL", "Test1" ); } task ( "Walk to t3" ) { set ( /*@SET_TYPES*/ "SET_NAVGOAL", "Test2" ); } task ( "Walk to t4" ) { set ( /*@SET_TYPES*/ "SET_NAVGOAL", "Test3" ); } } do ( "Walk to t2" ); do ( "Walk to t3" ); do ( "Walk to t4" ); wait ( "Walk to t2" ); rem ( "From Camera I to Camera II" ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam2", ORIGIN)$, $5000$ ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam2", ANGLES)$, < 0.000 0.000 0.000 >, 5000 ); wait ( "Walk to t3" ); rem ( "From II to III" ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam3", ORIGIN)$, 5000 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam3", ANGLES)$, < 0.000 0.000 0.000 >, 5000 ); camera ( /*@CAMERA_COMMANDS*/ ZOOM, 30.000, 3000 ); wait ( "Walk to t4" ); camera ( /*@CAMERA_COMMANDS*/ DISABLE ); Link to comment Share on other sites More sharing options...
lassev Posted October 26, 2005 Share Posted October 26, 2005 Do I have to say it now? What... did... I... screw... up... on... this... time??? Well, I would like to say you failed to even read what I have written before, but saying such a thing would form a paradox of redundancy as it would logically lead to the conclusion you won't read even this post... So, all in all, it doesn't matter what I write here. But just to be unnaturally friendly, I will quote myself and underline the important and relevant part: Usually scripts (or let's say individual affects as tasks are affect specific and there can be more than one affect per script) are built so that you have all the tasks in the beginning, one after another (but not inside each other), and then at proper place and time you DO (or DOWAIT) those tasks later in the script. That way you can quickly scan all the tasks later on if needed. However, it doesn't really matter technically as long as the task is defined before the DO command. Link to comment Share on other sites More sharing options...
lukeskywalker1 Posted October 27, 2005 Share Posted October 27, 2005 Why do you rearange in notepad? Here look- Another thing you can do is connect the navgoals together in order and tell the NPC to walk to the first one and it should follow the path (I assume, I think Lassev told me about this once) it could make things easier for you... Link to comment Share on other sites More sharing options...
StaffSaberist Posted October 27, 2005 Author Share Posted October 27, 2005 lassev - Sorry, it's been a long few days. I've been distracted by events at home. Please don't get angry with me. I am frustrating myself just as much. And I do pay attention. I didn't... I... ah, to hell with it, I was STUPID, ALRIGHT?? I am trying so darn hard to get this, and angering you in the process. I can say with some degree of accuracy that after this huge hurdle is passed, I will not need help again to script, map, or any of it. This will be the END of this thread, if there is one in sight. After I get this going, nobody in this forum will hear about it again until you see it as a WIP in the Showcase. Until then, I just have to get how to script it. You can see that I ALMOST HAVE IT, and probably will. And I do read what you say, I merely misinterpreted it. Remember before, when I had the affect, Walk1 inside if Affect, Walk2 inside of Walk 1, Walk3 inside of Walk2, then all the rest of the script inside of Walk4? Well, I got rid of that. I organized it BETTER, I just didn't do it the BEST. This angers me to no end, but I WILL have this project DONE BEFORE I GET A DRIVER'S LICENSE IN 1 1/4 YEARS! I say this long because I work alone. SO, I will get to work again. My apologies, lassev. No hard feelings, please. Please remember my n00b status! And as for you, shukrallah... just kidding. I will get this done. I really can't say anything that I haven't already said. So, I will play a little bit and relax. Then I'll tackle this scripting. Wait, now I do. I made my script as close to yours as possible. But the whole cutscene doesn't load. I'm uploading an image via imageshack. You should be able to tell me exactly what I did wrong. It looks like yours, and I'm 99.9% sure it's all set up in Radiant. I was just in there. I'm too tired now, I can't go on for a little bit. But I want this taken care of so I can get this and move ahead in this project, one that seems now to have no end. I dread going to it. If the next fix doesn't take care of this, I am going to take a 3-day vacation. It can't be healthy for me to do this all day. http://img380.imageshack.us/my.php?image=screenshot63id.jpg *collapses after a long day* Link to comment Share on other sites More sharing options...
lassev Posted October 27, 2005 Share Posted October 27, 2005 Another thing you can do is connect the navgoals together in order and tell the NPC to walk to the first one and it should follow the path (I assume, I think Lassev told me about this once) it could make things easier for you... I don't think I have ever said such a thing. I don't believe it yields anything to link navgoals together. As far as I know, the only way to use nav_goals is to use specifically the set_navgoal command. Although there are a few problems with that if you want the NPC to walk through a line of navgoals with consecutive DOWAIT("task")s, as it results to jerky moving, because the NPC slows down just before each navgoal. I'll need to solve this issue eventually... StaffSaberist, I think shukrallah mentioned earlier you need to have waits between the DO("tasks"). When you use the DO command, it doesn't pause the script. It will just set the task in motion and then immediately continue with the following commands in the script. That means basically only your last set_navgoal has any effect, as it overrides the two earlier ones. So, use WAIT("task") (or DOWAIT) or time it manually using wait(milliseconds). The exact same thing is true for you camera commands. If you enter a time of 5000 ms for a camera command, but it won't pause the script. The camera will start to move (or pan or whatever) using the given time limit, but the script will immediately go on, and in your case, execute the next camera command, thus overriding the old one immediately. You need ordinary wait(milliseconds) between the camera commands. Link to comment Share on other sites More sharing options...
lukeskywalker1 Posted October 27, 2005 Share Posted October 27, 2005 Exactly, you will just have to guess about the time it takes for the NPC to reach the navgoal. I don't think I have ever said such a thing. I don't believe it yields anything to link navgoals together. Hmmm... Must have been something else... Link to comment Share on other sites More sharing options...
StaffSaberist Posted October 27, 2005 Author Share Posted October 27, 2005 Okay. I have an exam to study for, can't get to work as of 3:11 Pacific Time. This is a break between home and studying. I'll get to that soon. So, these problems will cause the whole thing not to run? OK, makes sense. If I need to gauge the time... that must be the real reason it takes so long to publish a level. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.