Asterra Posted October 5, 2016 Share Posted October 5, 2016 (edited) Just one of those things. Obvious when you know what tools are available, but not so obvious otherwise. Here is what I'm trying to do: Detect when the player enters a certain location. When this occurs, investigate the contents of a container in said location, and make modifications to the contents of the container if necessary. The container, naturally, will not spawn its contents until the player has entered the area. This is what makes it necessary to wait until the player is near the container before making changes to the contents. If it were possible to make the container's contents dynamic at spawn, I would go about it that way, but it seems not. (PLEASE correct me if I'm wrong. The intent is to spawn certain things in the container based upon whether or not the player has X or Y. As far as I can tell, there is no built-in way to force this sort of particularized leveled item list.) Right now, all I can think to do is plunk down a trigger area and have a script run when the player touches it. Should work. But if I'm overlooking a perhaps more obvious and convenient event for when the player transitions to a certain cell, that's pretty much what I'm looking for. (Provided, of course, that I can count on the container's contents having been calculated prior to the event.) Edit: Actually I just recognized the flaw in my plan: The conditions dictating the container's contents may change between when the player triggers the activator and when they investigate the container. I therefore would need some sort of "when this container is opened" event, if such a thing exists. Help greatly appreciated. Edited October 5, 2016 by Asterra Link to comment Share on other sites More sharing options...
RoyBatterian Posted October 6, 2016 Share Posted October 6, 2016 You need a trigger volume, easy to do. Make an activator, and a script for it. Create the trigger volume in the render window and choose your created activator when the dialogue pops up. You'll need an object script with a block like: Begin OnTriggerEnter player do stuff End You can also script the container, and add an OnActivate block. There is examples for this already on the GECK wiki. Link to comment Share on other sites More sharing options...
larryrathbun Posted October 6, 2016 Share Posted October 6, 2016 Good afternoon, I believe you can use OnActivate on a container and have that script change the contents. Then have the script Activate the container. This isn't perfect, but it should be close. scn ContainerScript begin OnActivate if ( Player.GetItemCount [item] == 1 ) ;do whatever endif Activate End Link to comment Share on other sites More sharing options...
Mktavish Posted October 8, 2016 Share Posted October 8, 2016 (edited) And could be getscriptvariable Then Add your list to the container. ... but if that doesn't work ... then just add a pre planned container with items ... by simply using the "Enable" command ... meaning you have 5 conainters (err how ever many) sitting in one spot that are not enabled , until a certain script says to enable one of them. Edited October 8, 2016 by Mktavish Link to comment Share on other sites More sharing options...
Mktavish Posted October 8, 2016 Share Posted October 8, 2016 You said " If it were possible to make the container's contents dynamic at spawn, I would go about it that way" How dynamic are you needing ? How many objects ... and how many different possible end senarios ? Link to comment Share on other sites More sharing options...
RoyBatterian Posted October 8, 2016 Share Posted October 8, 2016 Dynamic at spawn you can use a leveled list for that, that is what they are for. Link to comment Share on other sites More sharing options...
Mktavish Posted October 8, 2016 Share Posted October 8, 2016 (edited) Dynamic at spawn you can use a leveled list for that, that is what they are for. Well I guess what the OP means by "Dynamic" needs some explaining. With leveled lists it means based on the players level it will pick this item ... but also can be a random roll between a number of items. From the way they went on to explain it ... it seems the random aspect of dynamic is not what they want. And the players level would not be the desired component to consider. It's all about whether the player did this or that ... possibly this and that and the other thing. Hence I was asking how many different items are there and or different triggering events . The posibilites of calculating that could be fairly extensive and end up pretty complicated. But I suspect there is an easy to the point way of achieving the desired render. If maybe the OP could just explain how they want said scenario(s) to play out. imo ^shrug^ Edited October 8, 2016 by Mktavish Link to comment Share on other sites More sharing options...
rickerhk Posted October 8, 2016 Share Posted October 8, 2016 If the contents of the container depend on actions taken before it is activated, then just add a game mode block to the container script. The activate block of the script enables a section in the gamemode block. The gamemode block adds the items dependent on the conditions, then skips a few frames before activating the container. Link to comment Share on other sites More sharing options...
Mktavish Posted October 9, 2016 Share Posted October 9, 2016 The activate block of the script enables a section in the gamemode block. The gamemode block adds the items dependent on the conditions, then skips a few frames before activating the container. Hmm ... so within the activate block you can then trigger a true condition for something to execute within the game mode block? Can you give me an example of that happening ? My mind works better with a hands on approach ... algebra is not my strong suit. Sorry to take over the OP's thread but what you said triggered my curiosity ... hehe ... Link to comment Share on other sites More sharing options...
RoyBatterian Posted October 9, 2016 Share Posted October 9, 2016 I assume the activate block would set a variable to enable the gamemode block to do something. Then the gamemode block would read what ever different variables and if true place the appropriate items in the container, and set a timer for a second or two and when it times out, activate the container. Link to comment Share on other sites More sharing options...
Recommended Posts