Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Claim: Unfinished AI and NPCs
06-12-2010, 12:34 PM,
#11
 
Hey IS, is it possible to have more than one bedref? I was hoping I could give the PC two choices, a cheaper and more expensive option.

Edit - I got a problem already: I named the script by adding scriptname BMIGSHBodeanScript but it says "unknown command 'SetRefs' (line 4)". :eek:
Cunning Linguist (Writer and Voice Actor - Lost Spires, St and many, many more.)
Lizard King - Leader of the Black Marsh mod
[Image: Buserbar.jpg]
Reply
06-12-2010, 03:34 PM,
#12
 
The error means there is a missing variable declaration, make sure it says:

Short SetRefs

At the top of the script with the other variables.

For the bed options you can remove this line from the script:

Set InnBed to

And instead use the dialogue result script to set the reference, for example:

Set YourNPCRef.InnBed to CheapBed
[color="#9ACD32"]How do you Skyrim? Show Us in TES Alliance's [url="http://tesalliance.org/forums/index.php?/forum/112-official-skyrim-contest/"]Salute to Skyrim Contest[/url]![/color]
Reply
06-12-2010, 10:37 PM,
#13
 
Okay, scripts still baffle me. I haven't a clue how they work. Here is what I'm typing in so far:

scriptname BMIGSHBodeanScript

Begin GameMode
If (Short SetRefs == 0)
Set 2BMDZBodean.InnBed to CheapBed
Set InnDoor to 2BMIGBodeanRentDoorRef
Set InnCell to 2BMIGStormholdLeyawiinLower12
Set InnKeeper to 2BMDZBodean
Set SetRefs to 1
Endif

If ( Renting == 1 )
If ( DoOnce == 0 )
Set RentDay to GameDaysPassed
Set DoOnce to 1
InnDoor.unlock
InnBed.SetOwnership
Else
If ( GameDaysPassed != RentDay)
Set Reset to 1
Endif
Endif

If (Player.GetinCell InnCell == 0)
If ( Reset == 1 )
Set Reset to 2
Endif
Endif

If ( Reset == 2 )
Set Renting to 0
Set DoOnce to 0
Set RentDay to 0
Set Reset to 0
InnDoor.SetOpenState 0
InnDoor.lock 30
InnBed.SetOwnership InnKeeper
Endif
Endif
End

This doesn't work. It stops earlier, even before it gets past the scriptname.

Btw, I added our first Naga in Pholmolo, a friendly Naga, tamed and loyal to the Pholmolo shaman.
Cunning Linguist (Writer and Voice Actor - Lost Spires, St and many, many more.)
Lizard King - Leader of the Black Marsh mod
[Image: Buserbar.jpg]
Reply
06-13-2010, 12:09 AM,
#14
 
Hi Ibsen, try this instead:
...................................

scriptname BMIGSHBodeanScript

Short Renting
Short RentDay
Short Reset
Short DoOnce
Short SetRefs

Ref InnDoor
Ref InnBed
Ref InnCell
Ref InnKeeper


Begin GameMode
If ( SetRefs == 0 ) ;; delete the word "short", add one space between parenthesis'
Set BMDZBodean.InnBed to CheapBed ;; rename 2BMDZBodean to have no "2"
Set InnDoor to BMIGBodeanRentDoorRef ;; rename to lack "2"
Set InnCell to BMIGStormholdLeyawiinLower12 ;; rename to lack "2"
Set InnKeeper to BMDZBodean ;; rename to lack "2"
Set SetRefs to 1
Endif

If ( Renting == 1 )
If ( DoOnce == 0 )
Set RentDay to GameDaysPassed
Set DoOnce to 1
InnDoor.unlock
InnBed.SetOwnership
Else
If ( GameDaysPassed != RentDay ) ;; needed one between last parenthesis
Set Reset to 1
Endif
endif ;; forgot this "endif"
Endif

If ( Player.GetinCell InnCell == 0 ) ;; needed space between each parenthesis
If ( Reset == 1 )
Set Reset to 2
Endif
Endif

If ( Reset == 2 )
Set Renting to 0
Set DoOnce to 0
Set RentDay to 0
Set Reset to 0
InnDoor.SetOpenState 0
InnDoor.lock 30
InnBed.SetOwnership InnKeeper
Endif ;; I deleted the "endif" after this one, it wasn't needed
End

.......................................

I deleted the "2" in the name above, because for certain names for editor ID's and other CS named objects, the CS/game will suffer from errors (so I've read about on various posts).

Never name an editor ID or reference ID with a name that starts with a number. You can used numbers in those names, if the first character in the name is an alphabetical letter.

You were missing spaces bwtween characters in certain areas, mostly between the parenthesis and the inner letter it was enclosing. Script spacing in Oblivion needs to be uniform, else the script might not work in the game (and won't give an error, so you are left scratching your head).

I usually "tab" to space the beginning of script lines, and use the spacebar to add one space in-between words and other characters on same lines after those lines have been tabbed into position.

Koniption
Yeah, don't let those little turds get you down. Dingleberries stick for a while, but eventually they fall off. Cool
Reply
06-13-2010, 10:27 AM,
#15
 
Good edit KP :goodjob:

For future reference though, OB scripts run/compile perfectly fine without spaces between parenthesis Smile, It does look a little cleaner though.
[color="#9ACD32"]How do you Skyrim? Show Us in TES Alliance's [url="http://tesalliance.org/forums/index.php?/forum/112-official-skyrim-contest/"]Salute to Skyrim Contest[/url]![/color]
Reply
06-13-2010, 12:20 PM,
#16
 
Okay, the following seems to have worked:
...................................................

scriptname BMIGSHBodeanScript

Short Renting
Short RentDay
Short Reset
Short DoOnce
Short SetRefs

Ref InnDoor
Ref InnBed
Ref InnCell
Ref InnKeeper


Begin GameMode
If ( SetRefs == 0 )
Set InnDoor to BMIGBodeanRentDoorRef ;; this line now comes before the one below, thus following the pattern outlined above (I figured this made sense)
Set InnBed to BMIGBodeanRentBedRef1 ;; removed the BMDZBodean. before InnBed
Set InnCell to BMIGStormholdLeyawiinLower12
Set InnKeeper to BMDZBodean
Set SetRefs to 1
Endif

If ( Renting == 1 )
If ( DoOnce == 0 )
Set RentDay to GameDaysPassed
Set DoOnce to 1
InnDoor.unlock
InnBed.SetOwnership
Else
If ( GameDaysPassed != RentDay )
Set Reset to 1
Endif
endif ;; forgot this "endif"
Endif

If ( Player.GetinCell InnCell == 0 )
If ( Reset == 1 )
Set Reset to 2
Endif
Endif

If ( Reset == 2 )
Set Renting to 0
Set DoOnce to 0
Set RentDay to 0
Set Reset to 0
InnDoor.SetOpenState 0
InnDoor.lock 30
InnBed.SetOwnership BMDZBodean
Endif
End

.....................................................

@ IS - However, another thought arose. The InnDoor reference refers to the room where the rented bed can be found. Do I need to make some reference to the actual door of the Inn as well? Plus, considering the fact that I'm trying to make two beds available here, I'm guessing that adding the line 'Set InnBed to BMIGBodeanRentBedRef2' after the Ref1 line would be a first step towards doing this. Considering the fact that the cheap bed does not have a separate door to the rented bed (it's a rollmat on the floor of the 'Inn'), is there anything more I need to consider there?

Anyway, I've attached this script to Bodean Altragel for now.

Edit - @ Koniption - I'm setting up a number of merchant AIs at the moment and giving them a lot of turtle and bamboo chests. These, however, are animated chests. Do I need to have a script attached to them that will make sure that the chests remain closed in case the PC decides to raid them?
Cunning Linguist (Writer and Voice Actor - Lost Spires, St and many, many more.)
Lizard King - Leader of the Black Marsh mod
[Image: Buserbar.jpg]
Reply
06-13-2010, 01:14 PM,
#17
 
Quote:Originally posted by InsanitySorrow
Good edit KP :goodjob:

For future reference though, OB scripts run/compile perfectly fine without spaces between parenthesis Smile, It does look a little cleaner though.

I was wondering...why does the CS wiki have this tutorial then ?:

http://cs.elderscrolls.com/constwiki/index.php/If

...At the very bottom, under the "Spaces and Tabs" heading, it mentions what I mentioned about script spacing. Is this part of the article redundant and erroneous?
...............................................

@ IG - About the animated chests, I'll send a PM so as to not derail this thread too much.

Koniption
Yeah, don't let those little turds get you down. Dingleberries stick for a while, but eventually they fall off. Cool
Reply
06-15-2010, 08:37 PM,
#18
 
Hey folks, I have another script issue here. I’m trying to add the Innkeeper script for Sloughpoint’s Inn and it’s not accepting it. There is no ‘InnRentDoor ‘ reference so I removed it but here is the script:
Quote:scriptname BMIGSPMerivaleScript

Short Renting
Short RentDay
Short Reset
Short DoOnce
Short SetRefs

Ref InnDoor
Ref InnBed
Ref InnCell
Ref InnKeeper


Begin GameMode
If ( SetRefs == 0 )
Set InnBed to BMIGMerivaleRentBedRef
Set InnCell to BMTLSloughpointInn
Set InnKeeper to BMIGSPMerivale
Set SetRefs to 1
Endif

If ( Renting == 1 )
If ( DoOnce == 0 )
Set RentDay to GameDaysPassed
Set DoOnce to 1
InnBed.SetOwnership
Else
If ( GameDaysPassed != RentDay )
Set Reset to 1
Endif
endif ;; forgot this "endif"
Endif

If ( Player.GetinCell InnCell == 0 )
If ( Reset == 1 )
Set Reset to 2
Endif
Endif

If ( Reset == 2 )
Set Renting to 0
Set DoOnce to 0
Set RentDay to 0
Set Reset to 0
InnBed.SetOwnership BMIGSPMerivale
End
It seems to be having a problem with line 41 which is the start of the last ‘paragraph’. It ‘Mismatched if/else/endif block starting on line 41’. Otherwise, I have just polished off Sloughpoint and made it a little more up-to-date with a full set of NPCs. Any ideas?

Edit - I just finished with the AI for three of the houses in RockGuard. I'll need to double-check the AI for the Guards in RockGuard (which will include changing their armour to our own Imperial retro-style) and to polish off the Inn in RockGuard then this settlement should be totally complete too (barring the dialogue that comes with questing).
Cunning Linguist (Writer and Voice Actor - Lost Spires, St and many, many more.)
Lizard King - Leader of the Black Marsh mod
[Image: Buserbar.jpg]
Reply
06-16-2010, 01:26 AM,
#19
 
Ibsen,

You need to add an "Endif" right above "End", in that last paragraph:
...........

If ( Reset == 2 )
Set Renting to 0
Set DoOnce to 0
Set RentDay to 0
Set Reset to 0
InnBed.SetOwnership BMIGSPMerivale
endif ;; need to add this
End

...........

Koniption
Yeah, don't let those little turds get you down. Dingleberries stick for a while, but eventually they fall off. Cool
Reply
06-16-2010, 04:18 PM,
#20
 
Cheers, KP. That's sorted it. We now have fully operational Inns at Sloughpoint and RockGuard. More to come.
Cunning Linguist (Writer and Voice Actor - Lost Spires, St and many, many more.)
Lizard King - Leader of the Black Marsh mod
[Image: Buserbar.jpg]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)