Jump to content

Can't select the script for my NPC.


Dimitrisgb

Recommended Posts

To be more specific, I am trying to fix some bugs in an alreay existing result script. I want to change the name of the NPC that is there to the correct name the NPC has. For example, I have wrongly written Ahdrisa, while the name is Adhrisa (d before h). When I change it it says that 'rent' is an unknown variable, which apparentlly wasn't when I first created it. So, what has changed and the 'rent' is an unknown variable.
Link to comment
Share on other sites

  • Replies 47
  • Created
  • Last Reply

Top Posters In This Topic

Oki. Click the code button [<>] in a message and iclude your code and we solve it for sure...

 

Like this:

scn Myscript

short variable 
float anothervariable

Begin GameMode
End

Then it will get easy to read but if I will make a guess, you deleted your initiation of rent and I giess it is a short?

scn YourScript

short rent

Every variable you use must be initiated or rather declared

Edited by Pellape
Link to comment
Share on other sites

Start with renaming Ahdrisa to Adhrisa and also the NPC Reference VALAhdrisa to VALAdhrisa or is that the NPC base Object name? If it is the Base Object Name then I strongly suggest you call that NPC Persistent Reference to VALAdhrisaREF

 

Open that NPC's script to see if the variable is declared and I am 99.98% sure it is a short and if it is missing, then add it.

Scn VALAdhrisaSCR

short rent

Begin GameMode

When calling a script from somewhere else, you do not call the Base Object as you call the reference and it must be Persistent. One Object can be placed in game several times and it is only one of all those objects you can make changes to so therefor you cannot call a script by using its base object ID. To make a Persistent reference, well give the reference a proper names and check the Persistent Reference check box.

 

If you are calling a variable within the same script, you do not need to call the reference that runs the script like:

player.removeitemgold001 10
set rent to 1

Or how do you execute the script as it should be in the conversation with that innkeeper.

 

To be very sure I do not mix up Base Objects, references, scrips, quests, spells and so on I always use special ending at their names and I can make an example of x:

 

Object x has ID Pekx which all my ID starts with -> Pek

If it is a

  • spell -> PekxSPL
  • Persistent Reference -> PekxREF
  • quest -> PekxQST
  • Script -> PekxSCR
  • Quest Script -> PekxQSTSCR
  • Spell Script -> PekxSPLSCR
  • Level List -> PekxLL

If you end your stuff that way, then you will always know what it is or was meant to be. :wink:

Edited by Pellape
Link to comment
Share on other sites

To be more specific, I am trying to fix some bugs in an alreay existing result script. I want to change the name of the NPC that is there to the correct name the NPC has. For example, I have wrongly written Ahdrisa, while the name is Adhrisa (d before h). When I change it it says that 'rent' is an unknown variable, which apparentlly wasn't when I first created it. So, what has changed and the 'rent' is an unknown variable.

 

Added some highlight in case you missed it Pekka ... I'm guessing it's a dialogue result script.

Link to comment
Share on other sites

I cannot find any Ahdrisa nor Adhrisa so Dimitrisgb must provide all info so lets see what info we need.
  • Which NPC did you choose to edit?
  • Where did you made the edit?
Provide all other necessary info we need to be able to solve this and I will try to make a step to step instruction how to do it. Innkeepers are a bit tricky which we have debated in a previous thread Edited by Pellape
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...