Scripting Problems

Talk about your new mod or map here

Moderators: jelco, bert_the_turtle

User avatar
briceman2
level2
level2
Posts: 123
Joined: Wed Dec 12, 2007 4:30 am

Postby briceman2 » Thu Jun 26, 2008 3:42 am

Cotcan wrote:Yes thankful the script is called, and it says the stuff. But doesn't move you anywhere. I have the cameras. But they aren't going to the cameras.

LOL my script for the game.txt is now working. I used the guide for it. Must of been the safe area. The cameras seem to only work from the game.txt one. But from the script trigger, the cameras don't work. That's strange.


Ummmm, that's impossible. If the script works one place it should work both. There is no possible reason for the game to skip camera commands that are in the script.

I have an idea. Do you have two versions of this script? One with cam cuts and one without? Check the ScriptTrigger in the level to make sure it is calling the right one.
Cotcan
level1
level1
Posts: 20
Joined: Tue Jun 24, 2008 10:49 pm

Postby Cotcan » Thu Jun 26, 2008 4:14 am

Only one script. They both have cameras. I thought it might be it not being global, but same thing.

Edit: I think the ScriptTrigger is only for saying stuff. Because I added a EnterLocation cammand, but it didn't crash. So now it auto-starts you straight into the 1st level. Its oh k for with that. But keep thinking of stuff. Maybe Xander can tell us something.

Edit: K nevermind, auto-start is annoying. Hope Xander knows how to fix the problem.
Last edited by Cotcan on Thu Jun 26, 2008 5:00 am, edited 1 time in total.
User avatar
briceman2
level2
level2
Posts: 123
Joined: Wed Dec 12, 2007 4:30 am

Postby briceman2 » Thu Jun 26, 2008 4:59 am

Cotcan wrote:Edit: I think the ScriptTrigger is only for saying stuff.

LOL!!!!1!!11! NOPE! Scripts are scripts. Doesn't matter how you start them -- game.txt or ScriptTriggers. Scripts behave the same both ways. It's the law. I've written dozens and they's never double crossed me yet!

Because I added a EnterLocation cammand, but it didn't crash.

If a command isn't appropriate for the situation it will simply do nothing. If you mispell a command it will simply do nothing. Nothing special here, but I think I begin to smell your problem...

So now it auto-starts you straight into the 1st level. Its oh k for with that.

Warmer, warmer warmer, burning hot! Now we're talking!

You need to understand that scripts care about where they are started. And script commands care if you are in a level or in the global world. Camera cuts never work in the global world. If your intro is starting outside a level, the cam cuts will not take you into the level - they will simply do nothing. But you can make Sepulveda Say anything anywhere!

I hope I'm right here, 'cause otherwise your prob is impossible. If you are going to do cam cuts you must first do an EnterLocation. You must already be in the level where the camera mounts are named. The names only exist when you are in that level.

But keep thinking of stuff. Maybe Xander can tell us something.


I can't stop thinking. It's a disease!

The problem isn't that he knows way more than me (he probably does), the prob is that you are not very good at communicating the details of your problems. You are making xander and I guess what the hell you are trying to tell us. xander is persistent and I 'm just too nice, and together we play good cop and bad cop. But we'd both be a heck of a lot happier helping you if you would tell us *exactly* what you do before the problem happens, and exactly what goes wrong, and exctly what you wanted to happen. I'm replying a lot 'cause I don't mind making wild assed guesses. xander doesn't work that way.

(and if you think xander is mean now, wait till he sees how you spell his name! But seriously, be nice to him and thank him once in a while! 'cause he's the only guy that has stuck with this forum since the beginning. I come and go. xander's always here.)
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Postby xander » Thu Jun 26, 2008 6:08 am

I would love to help, but I honestly don't know what you are asking to do.

First off, a script will do what you tell it to do, to the best of its ability. There are some commands that don't work all the time, such as EnterLocation or CamMov. In order to enter a location, you must be on the global map. To move the camera, you must (a) be in a level and (b) tell the script to move the camera to a valid location. Since you are having trouble with camera moves, I would suggest that you ensure that your camera mounts are spelt correctly, and in the proper file, and that you are actually in a location.

Also, is it safe to assume that English is not your first language?

-----

briceman2: a script doesn't really care where you started -- only where you are now. For instance, there are a couple of scripts in Insurrection that take you out of a level, swap some levels around, then drop you back into a level. Same thing in the original game. But that is minor pedantry. ;)

xander
User avatar
briceman2
level2
level2
Posts: 123
Joined: Wed Dec 12, 2007 4:30 am

Postby briceman2 » Thu Jun 26, 2008 6:33 am

xander wrote: But that is minor pedantry. ;)


Ha! I'll tell you now that when I was typing, "xander is persistent...," my very first (and strongest!) impulse was to type, "xander is pedantic," ... but I couldn't make it sound like the compliment it truely is! ;)



P.S. for Cotcan: the best way to tell us your problems is step by step. We need the details you aren't giving us. What you are saying doesn't make much sense, so we are forced to guess. (And don't take my swearing personally! I'm not angry with you.)
Cotcan
level1
level1
Posts: 20
Joined: Tue Jun 24, 2008 10:49 pm

Postby Cotcan » Thu Jun 26, 2008 7:11 pm

When I use the game.txt, the cameras work perfect. The script goes to the cameras. But when using the script trigger, it only does the talking, but not the camera movements. Which makes no since at all. When it should work for both.

Edit: Tried the dummy level, same problem. But this time no game.txt.
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Postby xander » Thu Jun 26, 2008 8:04 pm

Again, it is hard to say, because you are not really giving us enough information, but here is one possibility: from game.txt, I assume that you are calling the script's file name, i.e.

Code: Select all

   Event BuildingOnline:rebellion,8
      Action RunScript  rebellion_objA_com.txt
      End

but that in your mission file, the script trigger looks like this:

Code: Select all

   ScriptTrigger       13      2375.71 3719.14 2       1.00    0.00    0       -1     150.00 discovery_drs Squadie

(notice the lack of ".txt" at the end of "discovery_drs").

Earlier, I stated that the numbers on the end of strings_default.txt tags could be used to say large blocks of text, quickly and easily? Well, I think that this is what you have done. Essentially, when you leave of the ".txt" from a script trigger, Darwinia will interpret that as "Say all of the lines in strings_default.txt that are blank_#." So, instead of running your script, it is just saying the appropriate lines of text. This, actually, is an understandable error, as you cannot enter a "." in the Darwinia editor. The best solution is to edit the mission or map file, and put the ".txt" after the script name. You could also rename the file by removing the .txt, but that is probably not the best solution.

xander
User avatar
briceman2
level2
level2
Posts: 123
Joined: Wed Dec 12, 2007 4:30 am

Postby briceman2 » Thu Jun 26, 2008 8:40 pm

Cotcan, could you please post the Events section of your game.txt and the ScripTrigger line from your map (or mission) file? Just cut and paste into [ code ] blocks like xander does.

You are asking us to tell you the difference between two situations... without showing us the goods!

------

xander, I never knew you could get the Say lines to group like that! I have always remembered reading it somewhere, but never figured it out (or prob was too lazy to search enough since I haven't ever really needed it). I alays thought there must be a way to do this since Chris numberd and grouped all the Say lines in language.txt...

P.S. it's kinda fun trying to communbicate with an SMS kiddie, isn't it! ...*almost* like a foreign language!
Cotcan
level1
level1
Posts: 20
Joined: Tue Jun 24, 2008 10:49 pm

Postby Cotcan » Thu Jun 26, 2008 9:08 pm

Sure here are the codes:

Code: Select all

ScriptTrigger       140     3913.69 4135.61 1       1.00    0.00    0       -1     100.00 cityoflifeintro always

Code: Select all

   Event BuildingOffline :cityoflife,0 BuildingOffline :cityoflife,110
   Action RunScript  cityoflifeintro.txt
   End
User avatar
briceman2
level2
level2
Posts: 123
Joined: Wed Dec 12, 2007 4:30 am

Postby briceman2 » Thu Jun 26, 2008 10:27 pm

Thank You!

Now what's different between these two script calls? You sure you read xander's reply above? Cause he called it!

xander, give yourself a few xander respect points!

xander wrote: This, actually, is an understandable error, as you cannot enter a "." in the Darwinia editor.

Is this a Windows thing? In the linux 1.40b9 darwinia editor I type periods no prob! StaticShapes too.
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Postby xander » Thu Jun 26, 2008 11:31 pm

briceman2 wrote:Thank You!

Now what's different between these two script calls? You sure you read xander's reply above? Cause he called it!

xander, give yourself a few xander respect points!

xander wrote: This, actually, is an understandable error, as you cannot enter a "." in the Darwinia editor.

Is this a Windows thing? In the linux 1.40b9 darwinia editor I type periods no prob! StaticShapes too.

It might be a Mac thing, then. I don't think I have ever been able to type periods in the editor... let me check my notes.

* * *

You're right -- it isn't periods that are the problem it is underscores. Periods work properly. It is a good thing I got that confused, because I probably wouldn't have figured it out, otherwise.

xander
Cotcan
level1
level1
Posts: 20
Joined: Tue Jun 24, 2008 10:49 pm

Postby Cotcan » Fri Jun 27, 2008 12:14 am

My Mod works just fine now. No problems. The scripts work fine. Thanks for the help.
User avatar
briceman2
level2
level2
Posts: 123
Joined: Wed Dec 12, 2007 4:30 am

Postby briceman2 » Fri Jun 27, 2008 10:41 am

xander wrote:You're right -- it isn't periods that are the problem it is underscores. Periods work properly. It is a good thing I got that confused, because I probably wouldn't have figured it out, otherwise.

Underscores and dashes and everything else useful in filenames! Can't even Capitalize to make the comapacted names readable... so it's hard to even spellcheck what you type in those damn fields.

Funny how the brain works! Use the Force Luke... Confusion is your friend; Order your enemy. Well, at least when creative solutions are needed. Good job!

Return to “Mod Projects”

Who is online

Users browsing this forum: No registered users and 19 guests