Jump to content

ActorREF problem.


wcho035

Recommended Posts

TGBlank, many thanks for the help again, but I am still stuck. My apologies for not using the real names or variables earlier in my question for I had made my life more difficult for myself.

 

Alright for the sake of clarity and to the point. The quest script I am using is FollowersQuestScript since the script already exist. It is shared between two quest:

 

The hiring quest name is

Quest name : 1merchire

ID : 1merchire

 

The trooper dialogue Quest name is

Quest name :1Trooperspeechpack

ID:1Trooperspeechpack

 

FollowersQuestScript is a quest script which is shared between 1merchire and 1Trooperspeechpack.

 

In the FollowersQuestScript I have a line which is

*******************

ref warrioractor

*******************

So by following what you had suggested as interpreted by me.

 

In the topc which I used for hiring the trooper in 1merchire quest. I have these following lines in the Result Script (End) box.

**********************************************************

set followers.warrioractor to player.placeatme 1TrooperTemplate 1

*********************************************************

 

Now for the Trooper Dialogue Quest 1Trooperspeechpack, for the topic "1trooperfired" I have

these following lines for the Result Script (End) box.

 

**********************************************************

ref tempvar

set tempvar to followers.warrioractor

tempvar.disable

tempvar.markfordelete

**********************************************************

Okay the reason I use ref tempvar because the compilier does not recognised or parse

 

quest.var.disable

quest.var.delete

 

or in this case,

 

followers.warrioractor.disable

followers.warrioractor.markfordelete.

 

The syntax is incorrect, or I had made some syntax errors that I don't know if I have done so.

 

So I have to use a temporary variable as tempvar in the local Result Script (End) box to execute the disable and markfordelete fuctions.

 

Yeah, if you can have a look see at what to correct, that will be great.

Link to comment
Share on other sites

You seem to use in several places a "followers" quest (when you do followers.sumthing). Yet you do not mention it.

You dont "NEED" to use the same script for the two quests, actually, it'll just confuse you. Pick one of the two and store the ref value there and nowhere else.

The other thing that you should keep in mind is that the geck sometimes doesn't like quest names and ref names that start with numbers. So you should rename your quests to, say, a1merchire and a1Trooperspeechpack

If you do that, let's say you choose to keep the ref in the a1merchire quest. In that case, in the topic for hiring you will be doing:

set a1merchire.warrioractor to player.placeatme 1TrooperTemplate 1

 

and in the firing topic:

ref tempvar

set tempvar to a1merchire.warrioractor

tempvar.disable

tempvar.markfordelete

Link to comment
Share on other sites

that is a very good idea what you have proposed. but the complier does not like the idea of using Quest ID like a1merchire to call a variable, if you know what I mean by that.

 

E.g. The compliler does not like "a1merchire.warrioractor" for a1merchire is not the name of a script which you can called. I have tried changing the Quest name to "atemp" to avoid the number problem, so it is "atemp.warrioractor" and etc. The compiler just would not accept a1merchire.warrioractor is a variable or atemp.warrioractor.

 

So I am back to where I am.

 

Okay if I use the FollowersQuestScript, assign a ref variable at the top of the script.

 

Now doing what I had propose before, in the hiring quest I have

 

"set followers.warrioractor to player.placeatme 1TrooperTemplate 1"

 

(in the FollowersQuestScript I have "ref warrioractor" as above in a few messages before.

 

What would be the right code to use for 1Trooperspeechpack Result Script (End) box?

 

Still is

***********************************

ref tempvar

set tempvar to followers.warrioractor

tempvar.disable

tempvar.markfordelete

***********************************

 

The idea is to have a reference variable that can be pass on from one quest to another and I thought maybe having a script attach to both quest can act as a to middle man to the transfer of the values.

 

That is something I have tried and succeeded with the "wait" topic which I use for my hired NPC, which a value is set to one and the AI "wait" package wait will initiate and cause the actor to stand on guard at one location.

 

This is fustrating, if there is a placeatme function, why can't there is a proper one for removing actors like they have one like remove items? Jeezz

Link to comment
Share on other sites

The quest script doesn't store variables, the quest does.

Think of the script as, say, a backpack model. All the followersscriptquest scripts are, say, blue backpacks.

If you give one to one quest, and another to another quest, and put a mammoth on one of them, will you find the mammoth in the other?. If all you want is to store 1 mammoth, you don't need two blue backpacks.

 

As for not accepting the name change...

a ) did you clicked ok and closed the window and then opened it again?. The Geck needs you to confirm dialogues to add changes, and to reopen them to reload lists (so, if you add a script, you need to close and open your quest window to be able to see it.

b ) You still havent mentioned from where this "followers" quest you keep using came from. You say you have two quests, a script, and suddenly out of the blue you don't even use the store all the values on a third one, kinda makes hard helping you.

Link to comment
Share on other sites

Hey thanks again for the reply. I finally got the problem resolved however it is not the suggestion you had offered.

 

I move my hiring and firing code in the FollowersQuestScript and when an NPC is hired or fired, a temp variable from the script is used with the appropriate if conditions to make it work.

 

For those who wish to delete actors or NPC, the proper way to do so. Is

 

Something QuestScript

 

ref actor

short tempvar

 

(Then in between the "Game" and "End")

 

If statement tempvar = something

 

set actor to player.placeatme NPC value

 

endif

 

If statement tempvar = something

 

actor.disable

actor.markfordelete

 

endif

 

 

This is working for me.. but here will be a 5 second delay before you see the actor disappear.

 

I finally got a mod which you can hire companions which you can hire, follow, wait, inventory access, fire and heal the player or itself! WHOOHOO!

 

Now a mod similar to this where the Caravan follows you after you hire them and follow you till you reach a city. And now I have to experiment with the moveto command so that he will pay me if the actual desination is reach.

 

Thanks you TGBlank for your suggestions, and Cipscis for the actual ref explanation which lead to my breakthrough! Cheers guys!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...