Home   Help Search Login Register  

Author Topic: How to make a player answer an AI question in mission?  (Read 1181 times)

0 Members and 1 Guest are viewing this topic.

Offline ericstephenvorm

  • Members
  • *
 Good evening. I know my title sounds weird, but I have an idea in a mission I'm building that's proving a bit more than I can handle. Here's what I'd like to be able to do:

The player's job is to sneak up to a hill top and observe a meeting of two groups of people. He must be able to count the total number of people at that group and return to base and report that number CORRECTLY in order to satisfy the objective.

So, first, I don't know if there's any logic or interface whereby the player can enter in a number when asked a question, and second, I'd need to figure out how to code the objective as, for example: "5= true, everything else= mission failed."

Any thoughts?

Thank you for your comments.

Very Respectfully,

ESV

Offline Carroll

  • Members
  • *
  • Mission Designer (MP-"well tryin to capiche"
Re: How to make a player answer an AI question in mission?
« Reply #1 on: 22 Jan 2008, 04:57:35 »
You could try using the Radio activations of triggers?, eg: Alpha=1, Bravo=2, etc. Then if the answer your Recon dude needs to take back to his CO is 5, then he has to reply by radioing "Echo". Just set the correct condition to that trigger?

I'm afraid this is the only logical answer to your question that i could think of at present off-the-bat without detailing too much into a built script, & i know next to nothing about UI (interface) construction at this moment. Though i'm sure there are more experienced then i that may be able to give you exactly what you want

Still, i think you may find some potential using trigs  :scratch:

EDIT: Another relatively simple way to achieve this may be to add a bunch of addActions to the Officer, so that when the Recon returns to repot he can pick the correct Action. Just have the correct action call the consequence you want, ie in the form of a script.

Quote
eg: correctAnswer = officerName addAction ["5 men in Group", "Correct.sqs"], wrongAnswer = officerName addAction ["4 men in Group", "Wrong.sqs"]

Quote
;"Correct.sqs"
Officer removeAction correctAnswer
titleText ["Good work Soldier, better take a full squad back there and sort em out!", "Plain Down"]
"1" objStatus "DONE"
~5
[unitOne, unitTwo, etc] join ReconDude
removeAllWeapons ReconDude
ReconDude addMagazine "5Rnd_762x51_M24"
ReconDude addMagazine "5Rnd_762x51_M24"
ReconDude addMagazine "5Rnd_762x51_M24"
ReconDude addMagazine "5Rnd_762x51_M24"
ReconDude addMagazine "5Rnd_762x51_M24"
ReconDude addWeapon "M24"
exit


Quote
;"Wrong.sqs"
Officer removeAction wrongAnswer
titleText ["Are you sure you had both eyes open soldier? You seemed to report back awful quick!", "Plain Down"]
"1" objStatus "FAILED"
~3
titleText ["I better take a look for myself, i think you better stay behind and clean your weapon again!", "Plain Down"]
ReconDude playMove "AmovPsitMstpSlowWrflDnon_WeaponCheck1"
exit

Tested - crude, but it works! However i'm still unsure as to how to implement this sequence of events if the number of units spotted in the group would be random each time ???. Therefore if you were to use the above, i'm afraid to say, reduces the replay abilities of the mission somewhat, considering that the answer is going to be the same each time the mission is played. Like i said, crude but it works as is. But alas, i'm confident one of the fine scripting veterans here at OFPEC would be willing to show us both how such a course of events may be passed in a randomized environment :whistle:
S.W.Carroll [AE]
 
« Last Edit: 22 Jan 2008, 07:11:11 by Carroll »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: How to make a player answer an AI question in mission?
« Reply #2 on: 22 Jan 2008, 08:43:44 »
one way would be to use a dialog. you would need to design the dialog resource - basically an interactive form with buttons and text input fields - and then present the player with the dialog at the appropriate time. depending on the value entered by the player, the mission would continue appropriately. you should be aware that dialogs are not for the faint-hearted. there are tutorials and tools in the ed depot.

the other way would be the old-fashioned OFP way of using the knowsabout level between the player and the objects he's counting. you can keep a track of that via a simple slowly looping script, and once all objects have a high enough knowsabout level, the player may withdraw.

on a related note, is the scenario realistic? recon is sent to area, must make an assessment of the enemy's numbers. returns to base and reports the wrong number. how do the player's superiors know the assessment is wrong?

attached is an OFP demo mission showing the knowsabout method in action.
« Last Edit: 22 Jan 2008, 12:21:55 by bedges »

Offline Carroll

  • Members
  • *
  • Mission Designer (MP-"well tryin to capiche"
Re: How to make a player answer an AI question in mission?
« Reply #3 on: 22 Jan 2008, 09:19:24 »
Yes how does the Officer know the Recon Report delivered indeed contains false information? Considering on the first hand they were sent out there to do the recon, but yet on the second hand theres a possiblity that the intel report be wrong...why send them in the first place if the Officer already knows how many there are & can judge accordingly :dunno:

Well perhaps it is some kind of test the Officer has bestowed on the Unit? Testing whether the Spotter is a compulsive fibber or just forgetful, not sure...either way he wants to return a value to his CO & have the option of getting it wrong...hmm

Perhaps it is to determine whether a certain Unit survived an earlier skirmish, & the mission is event dependant on whether he survives to take part in the meeting...if so i'm sure there are better ways to return this value, in circumspect for example; ?!(Alive Unit):goto "Blah", getDammage, grouping Unit to a 'Not-Present' activated trig, an EH.
« Last Edit: 22 Jan 2008, 09:54:31 by Carroll »

Offline ericstephenvorm

  • Members
  • *
Re: How to make a player answer an AI question in mission?
« Reply #4 on: 22 Jan 2008, 16:22:30 »
Wow... OFPEC never fails to impress me. Thank you very much for both of your comments and efforts.

You raise an interesting question; one that I had not thought of... I suppose it's not a matter that the officer would know whether or not the recon player was wrong or right, but rather the mysterious god of the game that would just deny the player a chance to move on with the mission. And you're right, this whole scenario would make the re-playability of the mission rather limited.

I'm afraid the level of skill needed for designing an interface is far past me, considering I'm still flipping back to the beginner's tutorial every few minutes. But, you've definitely given me some good food for thought...

If anyone else has any suggestions, please let me know. In the meantime, I'm going to re-think what I can do with this part of the mission and see if I can come up with something better.

Thanks again!

ESV

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: How to make a player answer an AI question in mission?
« Reply #5 on: 22 Jan 2008, 16:32:21 »
the knowsabout method was used to good effect in the cold war crisis mission where gastovski had to locate 3 shilkas on kolgujev. this made sense plot-wise as intel would know there were 'at least' three shilkas, but not their positions - hence the recon mission.

if you amended your mission story slightly so that the player would be locating specific targets (which could be placed randomly thus increasing replayability) rather than tallying their numbers, the recon mission would make more sense.

Quote
The player's job is to sneak up to a hill top and observe a meeting of two groups of people

what if the player's job is to identify which of several suspects is leading each of these groups. "It could be badguy A, B or C - we need you to find out."