Jump to content
The Dark Mod Forums

broken objective 'item in location' AND 'item in info_location'?


Recommended Posts

I've been building a rather large fm, no doubt more than I can handle (but it's fun and DarkRadiant is amazing!): 

brushes 17000, patches 8700, entities 5650.  Perhaps I've overloaded the system and have to break it into 2 linked parts, which would require rethinking the storyline so each part has a definite start/middle/conclusion.  Still, it's smaller than The Painter's Wife in all respects. 

Anyhow, I've run into problems setting objectives "item is in info_location".  I'd earlier wasted time trying to get "item is in location" to work and finally gave up, shortly before a bug was reported and the warning put in the wiki.  I can get "item is in info_location" to work, but only one instance.  I imagine the player gathering up various objects and placing them here and there to trigger objective complete, helping to give a concrete sense to the gameplay - so multiple instances are required.  When I try to add a second "item is in info_locaton" I get all kinds of errors, most common being the first info_location objective gets broken - drop the item and previously working "objective complete" isn't triggered.  I've verified that 2 info_location  objectives work, but in separate maps.  Putting them together in one map is impossible.  I've had them both activated and where the first (original) one still works, but then the 2nd one doesn't work, or the droppable item drops but loses all properties, it just hangs statically in the air until picked up again (maddening!).  I've tried about every possible configuration that I can think of.   

One interesting configuration happened when I had the first info_location completion trigger the visibility of the 2nd.  That set up a loop, "objective complete" endlessly ringing out with the text.  

So I dunno, is the info_location objective broken or am I missing something obvious?

  • Like 1
Link to post
Share on other sites

Yeah, that's a problem.

The Joebarnin solution is "Two entities are in the same radius of each other".

I used this in my last mission as well and it works as it should. Give it a try.

 

 

Link to post
Share on other sites

Hi JackFarmer, I didn't realize that the 'info_location' objective was a known bug.  The wiki directs mappers to use 'info_location' because 'location' is broken and for some reason google searches on problems with 'info_location' didn't show anything.  But good to know!  I've been tearing my hair out.  I wonder about existing maps using multiple 'info_location' and/or 'location', whether they're all broken?

I've tried "two entities in a radius" and so far haven't got it to work.  Even once.  So I put experimenting on that aside, going nuts trying to figure out my mistakes with the others being more than I could take already.  But now I'll keep trying and will check out your fm.  

Seems to me that the looping behavior when one info_location objective triggers the next, so they're overlaid for that exact "objective complete" moment, suggests that somehow completing the one instance triggers a global response for every possible info_location objective in the fm.  Or something...  hehe.  I'm clueless about coding. 

Link to post
Share on other sites
1 hour ago, geegee said:

Hi JackFarmer, I didn't realize that the 'info_location' objective was a known bug.  The wiki directs mappers to use 'info_location' because 'location' is broken and for some reason google searches on problems with 'info_location' didn't show anything.  But good to know!  I've been tearing my hair out.  I wonder about existing maps using multiple 'info_location' and/or 'location', whether they're all broken?

I've tried "two entities in a radius" and so far haven't got it to work.  Even once.  So I put experimenting on that aside, going nuts trying to figure out my mistakes with the others being more than I could take already.  But now I'll keep trying and will check out your fm.  

Seems to me that the looping behavior when one info_location objective triggers the next, so they're overlaid for that exact "objective complete" moment, suggests that somehow completing the one instance triggers a global response for every possible info_location objective in the fm.  Or something...  hehe.  I'm clueless about coding. 

To my knowledge, the "info_location"  objective has never been working in the past. The other possibility ("location") worked in the past and has been implemented in lots of missions, but neither Joe nor I myself got it running when working on missions around 2018/2019. 

I too am wondering how that effects older missions.

HHTLC uses the radius objective to determine the position of cubes that can be rotated. There are four positions for the main cube to be checked and for each side of the main cube three additional positions on smaller cubes because those can be rotated on three segments. Thus, you can see that there are four "radius" objectives (main cube)  each including three objectives on the component level for the smaller cubes. 

Using the same setup in  a different environment would enable you to create an objective where one would have to place three items in four different locations.

Maybe it is better to check one of Joe's missions (Heart of St. Mattis, Mission of Mercy, Now And Then) because I think the setups there are easier to understand.

If you do not get it working, just drop me a PM and I will look into the problem in you WIP.

Jack

Edited by JackFarmer
Link to post
Share on other sites

Thanks Jack!  I copied the format for ""Two entities are in the same radius of each other" in Heart of St. Mattis and, for two readables and two locations it worked!  A major step forward, that!  Also in my WIP I had  a separate atdm:target_addobjectives_N for every new objective N,  so I changed over to your way of doing it with just the one atdm:target_addobjectives containing the entire list 1,2,...,N.  Much better.

It still doesn't work for the func_static I put in an atdm:moveable_base cover.  As I said, this droppable item worked when dropped into an info_location target - but only once and it broke everything else.  But the identical cloned item pasted in my test map wasn't properly droppable, it would just hang statically in the air having lost all the droppable properties.  But now my focus has tightened and I imagine that I can work that out.  Perhaps exporting it as .ase and working with the model would....  anyway I'll see.

Thanks again!!

Objective complete!  The droppable I made as per the wiki is composed of two parts, the func_static and the atdm:moveable_base.  I reverted these to worldspawn then exported as .ase (which probably isn't required) then changed it into a single atdm:moveable_base droppable.  I guess that should've been obvious, what with the stress on "name of single entity" found everywhere, and that two means two.

Edited by geegee
Link to post
Share on other sites

Even if you worked out the issue, I would like to present an alternative. It may not be applicable, depending on how exactly you want to handle the objective, but it may still give you another approach. Also, it involves some scripting, but even I got it to work, so the scripting can not be too difficult and I can post the required script, if you are interested.

In this setup you have a frobable object, e.g. a pedestal, that is activated by an inventory item (via the spawnargs used_by_inv_name and used_action_script). Additionally you have a func_static of the inventory item in the place, where it should be placed with the spawnarg "hide 1", so it is invisible at map start. Using the inventory item on the frobable item starts a script that removes the item from the inventory, un-hides the func_static, and completes the objective. You can also make the frobable item unfrobable, so it is clear that it served its purpose. It does not look as realistic as the actual drop from the inventory, but it is clear enough, what happens. Additionally, you can use it for items that should not simply be dropped somewhere, but e.g. hung onto a wall.

Link to post
Share on other sites

@Destined

Yes, I'd be most grateful if you post your script.  Your method opens the door to whole new possible scenarios in a storyline. Sounds a bit like finding a valvewheel, transporting it across the map to the broken gate, snapping it in place and voila, the gate works!

edit to add: thanks for the script!  

Edited by geegee
Link to post
Share on other sites

Ok, no problem. I used the setup for a func_stativ, but you are right, you can also hide a switch, that afterwards works just normal. For the script, I will put any custom names you neeed in square brackets.

To repeat the setup: you need an item in the inventory with the spawnarg "inv_name [item1]" (I usually use the same name for the entity name) and an object that is frobable and has the spawnargs "used_by_inv_name [item1]" and "used_action_script [name_of_your_script]". The item that should appear (let's call it [hidden_item]) is already where it should appear and needs the spawnarg "hide 1". Finally, if you want to be this to be an objective, you need to know which number your objective has to complete it. This can simply be found by opening the objectives manager (herer called [obejctive_number]). Note that, if you insert other objectives and move them before this one, you will have to update the number in the script. The script then should look like this:

void [name_of_your_script]()
{

    $player1.getFrobbed().setFrobable(0); // This line sets the currently frob-highlited entity unfrobable. As an alternative, you can use the name of the entity instead of "getFrobbed()"
    $player1.replaceInvItem ($[item1], $null_entity); // This and the next line remove the item from the inventory and select the next one
    $player1.getNextInvItem();
    $[hidden_item].show(); // This line reveals the hidden item
    sys.wait(1); // Not sure if this is necessary here. In my own script there were other things supposed to happen and a short pause was required. You can try to remove it
    $player1.setObjectiveState([obejctive_number], OBJ_COMPLETE); // This line is required to complete an objective related to this setup. If you don't want to introduce an objective, you can delete this line.

}

It should be possible to simply copy/paste the script and replace all stuff in square brackets with the respective names of entities in you map. If you have any more questions or it does not work, feel free to ask.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...