Geck 1.4 not recognizing Begin

Post » Mon Jul 11, 2011 2:14 pm

So I wanted to make a little script that ran whenever you activated drinking fountains to give you a bottle of dirty water in exchange for a milk bottle (so they could be useful).

What I tried was this:
scn Fill WaterBottlesBegin OnActivate        if ( player.GetItemCount Milkbottle01 >= 1)              player.AddItem WaterUnpurified 1              player.RemoveItem Milkbottle01 1        endEnd


Which I thought was simple enough to work. At first, it just wouldn't save, without giving errors, so I found the Geck Power Up, used it, and now it tries to tell me, for the same script "End without matching Begin"... which is strange as I clearly have a Begin statement in there.

Any thoughts as to why this isn't working, and any suggestions to go about fixing it?


Actually, never mind, found my own problem. The 'if' statement block needed to be terminated with an 'endif', not an 'end'.... so used to other languages where you can just say 'end'...
User avatar
Juanita Hernandez
 
Posts: 3269
Joined: Sat Jan 06, 2007 10:36 am

Post » Mon Jul 11, 2011 7:28 pm

What I tried was this:
scn Fill WaterBottles



Also, avoid using spaces in script names.
That will actually name your script 'Fill'
User avatar
Alyna
 
Posts: 3412
Joined: Wed Aug 30, 2006 4:54 am

Post » Mon Jul 11, 2011 3:47 pm

Hahha, that was actually a typo (typed script in and accidentally put the space... given how small script was didn't see the point in copy/pasting)
User avatar
kirsty williams
 
Posts: 3509
Joined: Sun Oct 08, 2006 5:56 am


Return to Fallout: New Vegas