astymma Posted February 28, 2014 Posted February 28, 2014 SmallerTalk actually uses this: refHolder.StartConversation player, SmallerTalkGreeting ref.refHolder ref.Player 1 1 refHolder being the holder of the token Basically... The holder of the token is refHolder, it calls StartConversation... the player is the one who will be targeted... refHolder will use topic_id of SmallerTalkGreeting when conversation is initiated... the starting location reference if movement is required is ref.refHolder... the ending location reference if movement is required is ref.player... head tracking is allowed so the NPC looks at the player during the process... because movement to the target is permitted. You can obtain the editor location reference id of any reference by preceding the reference with "ref.". It's shorthand. Using the location refs is what allows SmallerTalk to permit movement of speaker towards target even through cell transitions. The point being that the call is neither "mental" nor "superfluous"... but required...
DoctaSax Posted February 28, 2014 Posted February 28, 2014 You can obtain the editor location reference id of any reference by preceding the reference with "ref.". It's shorthand Just when I think I'm starting to know shit, astymma walks in Come to think of it, other than startconversation, I can't think of a function that specifically requires or takes editor refIDs.
prideslayer Posted February 28, 2014 Posted February 28, 2014 As I said, I knew better than to question it. Looking mental and *being* mental.. well.. different things as often as not in the GECK. I remember a few months or a year back some guy looked at the sexout code and called me a martian.
astymma Posted February 28, 2014 Posted February 28, 2014 You can obtain the editor location reference id of any reference by preceding the reference with "ref.". It's shorthand Just when I think I'm starting to know shit, astymma walks in Come to think of it, other than startconversation, I can't think of a function that specifically requires or takes editor refIDs. I think the reason why StartConversation specifically takes those IDs is to facilitate pathing. Having the refIDs allows the engine to not have to traverse the Scene Graph to find the pertinent navmeshes for pathing. It has reference to them from the call. It can immediately start working on pathing the actor to the target. Specifically, I believe that when the editor ref is loaded, it's kept updated by the engine in real time in memory. Providing the reference gives the current information for the actor. It's why prefacing a reference with "ref." is useful. Alternatively, if that's not correct... then it's used as a shortcut into the pathing algorithm... what we call in AI a pathing hint. It shears leaves off the binary search tree.
t3589 Posted February 28, 2014 Posted February 28, 2014 I'm struggling with something. I'm trying to create mutiple dynamic quest objective targets. Example: - PC makes a date with any particular NPC. - That NPC becomes the quest objective target. Now I know I can just add conditionals to the objective for almost every NPC in the game. But I'd rather not. I was thinking of something like: - place a bunch of persistant tokens in a hidden location somewhere. Then as the NPC is chosen: - check to see if any of the persistant tokens are avaiable. - move the first available persistant token to the NPC inventory. And then use those tokens as quest objective targets. But I don't know how to move a persistant item from somewhere in world space to the NPC inventory and back? Will this even work? Or am I barking up the wrong tree to accomplish this?
astymma Posted February 28, 2014 Posted February 28, 2014 ContainerRef.RemoveAllItems ActorREF 0 1 That moves all items from a container and gives them to the actor. The only actual MOVE of the object functions. Everything else is a copy and/or destroy. EDIT: RemoveAllTypedItems also is a MOVE. RemoveItem is a delete. 2nd EDIT: Oh and YES... the method you discussed is the only way AFAIK to have dynamic mobile quest targets.
astymma Posted February 28, 2014 Posted February 28, 2014 The hard part... putting the token BACK in the container....
t3589 Posted February 28, 2014 Posted February 28, 2014 (edited) The hard part... putting the token BACK in the container.... lol I just now came back here because I've been trying to figured that out. Poo. First I think I'd have to make a container for each token, which sucks but would eliminate moving all of them to the NPC, filtering them out, leaving one behind, and then moving the rest. But you're right I'm still stuck with that token. Unless I want to dump their entire inventory into the container, but then that will be stuck there. Crapola. Typed Items won't work as a filter? (He said in a deperate attempt to alter your definition of 'ONLY'.) lol What about the respawn flag on the container? Would those still be considered persistant though if it respawned the tokens? If so I could just send the used tokens somewhere when they're complete? I don't know jack about world space stuffs. EDIT: NVM just saw your edits. Going to try typed and see what I can prop up. EDIT EDIT: Bah! That's turning out to be just as much work as adding them. I surrender. Edited February 28, 2014 by t3589
Odessa Posted February 28, 2014 Posted February 28, 2014 Could you use a type that isn't used by anything else for the token, casino chips are pretty rare, but there are ones not used at all (if you can use them somehow) What if the token has an object script, when quest stage == X, disable, when stage == Y, enable. I have no idea if this works, disabled items may well still get moved and just use removealltyped items on other stuff. Otherwise you could removealllitems to your chest, then ~5 removealltypeditems back again (weapon/ammo/armor/outfit/alchemy codes), and who cares about other stuff
t3589 Posted February 28, 2014 Posted February 28, 2014 (edited) Could you use a type that isn't used by anything else for the token, casino chips are pretty rare, but there are ones not used at all (if you can use them somehow) What if the token has an object script, when quest stage == X, disable, when stage == Y, enable. I have no idea if this works, disabled items may well still get moved and just use removealltyped items on other stuff. Otherwise you could removealllitems to your chest, then ~5 removealltypeditems back again (weapon/ammo/armor/outfit/alchemy codes), and who cares about other stuff It gets pretty convoluted. Typed moves all of them with that code. So for example I could: - check NPC inventory for items of XYZ type. - if they don't have any of those type, use that type. However, this increases the number of containers I have to make. One for every type. Plus within each type there has to be one for each 'date' slot. So 1 x type x total date slots x duplicates for 'in use' types.... It makes me drowsy. It also limits how many dates a PC can make, which in turn sort of defeats the purpose of needing a marker in the first place. ie. If I put limits on it then it wouldn't take so many containers but, if you can only make 2-3 dates you don't really need a marker. If you make lets say 12 dates, then a marker would be helpful. There are a couple of other ways I can see as you mention. But all of them are just as convoluted as the example above. EDIT: The disable/enable idea would be nice. I might try it when I get over having my ass kicked. lol Edited February 28, 2014 by t3589
nyaalich Posted February 28, 2014 Posted February 28, 2014 I resolved my previous problem of not being able to assign a greater number of special points to a companion by creating a class. I misremembered class as being something else had had 2-3 options and seemed fairly useless. New quandry: I'm trying to get a script together that allows you to let a companion read a copy of one of your skill books. In dialogue, you say that you want to share a book, and they say okay. A menu message box pops-up so that you get to choose which one you want to give them. This is triggered currently by adding a token to the companion's inventory with OnAdd > display message. The problem is when trying to use the script for custom companions where the refs would have to be obtained in game as opposed to static vanilla refs. From looking at other threads, you can't use GetSelf reliably in the Begin script box. You can use it in the End script box, but by that time, the actual dialogue has gone back to the main menu. Besides looking bad, its showing the main dialogue menu BEFORE you've made your selection. So the "I want to share a book" option shouldn't display if there are no more books to share, but it will since you haven't picked one to share yet. I know that I could put ShowMessage in the Begin script box, but I don't know how to pass the target ref to a script that controls the message.
nyaalich Posted February 28, 2014 Posted February 28, 2014 GetContainer works in the Begin script box to get the NPC?
t3589 Posted February 28, 2014 Posted February 28, 2014 GetContainer works in the Begin script box to get the NPC? What's a begin script box? If you mean onadd block then yes.
nyaalich Posted February 28, 2014 Posted February 28, 2014 Sorry. On the Topics tab of a quest, the Result Script (Begin) script box at the bottom left of the window.
t3589 Posted February 28, 2014 Posted February 28, 2014 Sorry. On the Topics tab of a quest, the Result Script (Begin) script box at the bottom left of the window. Wouldn't know sorry. I never 'get' any kind of ref in dialogue results scripts. I'd say no because the call is not coming from a 'contained' something.
jaam Posted February 28, 2014 Posted February 28, 2014 GetDialogueTarget GDTGetDialogueSubject GDSGetDialogueSpeaker GDK Here, you want GDT most likely
nyaalich Posted February 28, 2014 Posted February 28, 2014 jaam: You are like a wise hermit. I rarely see you in threads, but when I do, it is because you decided to leave your cave to bestow your knowledge upon the masses.
prideslayer Posted March 1, 2014 Posted March 1, 2014 No, GetContainer will not work in the dialog scripts. Those scripts are run on the actor, not items or containers.
nyaalich Posted March 1, 2014 Posted March 1, 2014 GetDialogueSpeaker worked. However, I had to use a local variable, which I realize is a frowned-upon practice.
astymma Posted March 1, 2014 Posted March 1, 2014 As long as you follow a procedure of initializing your local variables to a CONSTANT before then applying a DYNAMIC value to them, you should be fine... Like so: ref DangerousREF set DangerousREF to SafeConstantREF; constant assigned ... set DangerousREF to GetActionRef; dynamic return value assigned
prideslayer Posted March 1, 2014 Posted March 1, 2014 Anything available in the geck counts for that purpose, right? E.g. playerRef would be suitable? What about a constant value like simply using 0?
astymma Posted March 2, 2014 Posted March 2, 2014 Yeah, I initially advised using 0 to initialize refs but also mentioned that if that doesn't work, try ANY constant reference... playerRef should be fine... though I'd probably use a reference unlikely to be edited ( an XMarker you place in your own mod in a closed, unreachable cell for example). Or one that is unrelated to your task... if you are gonna store an actor in it dynamically, use something OTHER than an actor as your constant. Helps with debugging.
Odessa Posted March 2, 2014 Posted March 2, 2014 With an object script is it possible to get the form of the item it is attached to? I am making a mod to make fresh food rot, I have an object script with a slow menumode block attached to ingestibles, I tried GetSelf, but that returns 0 Then I can change Gecko Steak -> Dubious Gecko Steak with chance of campylobacter. I would rather not make a seperate script for every food item
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now