Scripting Compiling Error

Post » Fri Jan 22, 2010 9:32 am

Alright. So, I was writing this script in the hope that it would work. It does not. What I WANT it to do is that when you enter the cell (not for the first time, that's why its not just a DoOnce script), and you have a certain journal entry, a npc is teleported ahead of you with the command "PostionCell".

Heres the script:
Begin 01mc_savethenoobs_DTif ( GetJournalIndex "mc_dissidentpriest" >= 330 )	returnendifelseif ( GetJournalIndex "mc_dissidentpriest" = 340 )	"01mc_DrevisTaphael"->postionCell 2717 4553 12169 0 "Abal Chuflour's Shack, Hidden Area"	endifendifEnd 

There are three errors: "01mc_DrevisTaphael" reference object not found (I Don't know why, i'm looking at it as i type this; copy and pasted i.d.)
: Script command PositionCell not found
: mismatched endifs starting on line 6

I'm completly at a loss as to why any of those occured. There are two if's and two endif's, so i don't know what's up with that. Any help appreciated, thanks!

EDIT: I tried to compile the script in MWEdit and got a complete different set of errors >.<

This is what I have according to fixing the errors it gives.
Begin mc_savethenoobs_DTif ( GetJournalIndex "mc_dissidentpriest" >= 330 )	returnendifif ( GetJournalIndex "mc_dissidentpriest" = 340 )	"01mc_DrevisTaphael"->postionCell 2717 4553 12169 0 "Abal Chuflour's Shack, Hidden Area"endifend


It it still says that where the = is in
( GetJournalIndex "mc_dissidentpriest" = 340 )

was expected to be a ) , not a =. I don't know. Im confused..
User avatar
Wayland Neace
 
Posts: 3430
Joined: Sat Aug 11, 2007 9:01 am

Post » Fri Jan 22, 2010 12:11 pm

The ID is probably related to creating the NPC after you opened the script window. Close and reopen it with the NPC saved into the data file.
The PositionCell error is because you skipped the first i in the script itself.
You need to use the comparison operator (==) in the if condition. = is assignment, or would be, if MW didn't use Set/To.
User avatar
Alister Scott
 
Posts: 3441
Joined: Sun Jul 29, 2007 2:56 am

Post » Fri Jan 22, 2010 8:56 am

http://sourceforge.net/projects/mwedit/ can help you a lot with syntax errors/quirks, remember to expand the error log section on the bottom if it is hidden so you can find the exact error line. Use MWEdit to fix the script, copy/paste it back to TESCS, compile/save it from TESCS.
[EDIT]typos & C.
User avatar
Rozlyn Robinson
 
Posts: 3528
Joined: Wed Jun 21, 2006 1:25 am

Post » Thu Jan 21, 2010 9:12 pm

Alright. So, I was writing this script in the hope that it would work. It does not. What I WANT it to do is that when you enter the cell (not for the first time, that's why its not just a DoOnce script), and you have a certain journal entry, a npc is teleported ahead of you with the command "PostionCell".

Heres the script:
Begin 01mc_savethenoobs_DT1)if ( GetJournalIndex "mc_dissidentpriest" >= 330 )2)	return3)endif  <=== this matches the if on line 14)elseif ( GetJournalIndex "mc_dissidentpriest" = 340 )  <=== there is no if for this line.5)	"01mc_DrevisTaphael"->postionCell 2717 4553 12169 0 "Abal Chuflour's Shack, Hidden Area"6)	endif <=== this matches the elseIf on line 5 and there is no if statement for this block7)endif  <=== there is no if for this endIf ether


Here is how this script should be written. Notice that the first if statement is for the journal entry set to 340. If you have the two if statements reversed as you had them before and the journal is set to 340 then because 340 is greater than 330 the only possible result would be nothing happening.

Begin 01mc_savethenoobs_DTshort doOnceif ( GetJournalIndex "mc_dissidentpriest" = 340 )        if ( doOnce == 0 )        	"01mc_DrevisTaphael"->postionCell 2717 4553 12169 0 "Abal Chuflour's Shack, Hidden Area"                set doOnce to 1        endIfelseif ( GetJournalIndex "mc_dissidentpriest" >= 330 )	returnendifEnd 

User avatar
Kayleigh Williams
 
Posts: 3397
Joined: Wed Aug 23, 2006 10:41 am

Post » Thu Jan 21, 2010 11:22 pm

The ID is probably related to creating the NPC after you opened the script window. Close and reopen it with the NPC saved into the data file.
The PositionCell error is because you skipped the first i in the script itself.
You need to use the comparison operator (==) in the if condition. = is assignment, or would be, if MW didn't use Set/To.



http://sourceforge.net/projects/mwedit/ can help you a lot with syntax errors/quirks, remember to expand the error log section on the bottom if it is hidden so you can find the exact error line. Use MWEdit to fix the script, copy/paste it back to TESCS, compile/save it from TESCS.
[EDIT]typos & C.



Here is how this script should be written. Notice that the first if statement is for the journal entry set to 340. If you have the two if statements reversed as you had them before and the journal is set to 340 then because 340 is greater than 330 the only possible result would be nothing happening.

Begin 01mc_savethenoobs_DTshort doOnceif ( GetJournalIndex "mc_dissidentpriest" = 340 )        if ( doOnce == 0 )        	"01mc_DrevisTaphael"->postionCell 2717 4553 12169 0 "Abal Chuflour's Shack, Hidden Area"                set doOnce to 1        endIfelseif ( GetJournalIndex "mc_dissidentpriest" >= 330 )	returnendifEnd 



PeachyKeen- I think your right, now that I think about it I think I made it after I the NPC during the script. I'm not sure. As for the rest, I know I should know that, maybe one day I'll stop asking this stupid questions >.<

Abot- That's what I used to spot these errors, Thanks for the link though :D

Nicholiathan- I just opened your script into the CS and I got all of the same errors. >.< What's up with that?

EDIT: The NPC i.d. error is fixed, I simply had a space in the I.D. in the NPC tab on accident :brokencomputer:

EDITTT!: Postion. has. an. I. in. it. :brokencomputer: :brokencomputer: :brokencomputer:
Position, not postion. ALl errors fixed. :facepalm: :facepalm:


Thanks for the help everyone!
User avatar
saxon
 
Posts: 3376
Joined: Wed Sep 19, 2007 2:45 am


Return to III - Morrowind