How to: Interaction w/ objects

+
How to: Interaction w/ objects

I found out that creating interactive objects - for starting scenes (like body examination in W2) or triggering other scripts - is pretty simple. So here's a quick guide.

How to make an interactive object:
1) Copy entity template of an object you want Geralt to interact with (for example some book) and open the copy;
2) Right-click on the Components field (over the panel with Template properties, Body parts etc.) and choose [Create 'CInteractionComponent'];
3) Click on newly created Interaction Component and choose Node properties from the panel below;
4) There are many options to customize said Component, but for this to work you got to fill:
- name (eg. read_book, examine_body);
- friendlyName (eg. Read, Examine);
- actionName (choose from drop-down menu, eg. Use);
- change showHint, checkCameraVisibility and reportToScript flags to true;
5) Save entity template, drag it into your level and tag it;

How to use it:
1) Create a Pause (right-click -> Flow control -> Pause) in your Quest file;
2) Add [CQuestInteractionCondition] condition from the drop-down menu in Pause properties;
3) Fill in interactionName (as above, eg. read_book, examine_body) and ownerTags (with tag you used for entity dragged into level);
4) Now you need to connect Pause with the rest of your Quest flow and a script you want to trigger by interacting with object (like dialogue scene);

And that's pretty much it for now. Stay tuned for more.
 
Hey thank you, I was trying to do this for the longest time and I was so close. One issue I do see is that the interact is active even when you are not on the quest. This gives you the icon but doesn't actually do what its supposed to until you activate that part of the quest.

Is there anyway to disable the interact until a certain stage (similar to enabling triggers)?

Thanks again!
 
Yes, you can do this the same way as with triggers - just disable your InteractionComponent in the Entity editor and enable it with EnableComponent (I'm not sure if that's the exact name) script when it's needed.

- Horn
 
yea i tried doing that but it didn't work. The QEnableComponent didn't enable the entity... have you tested that it works?

I have a few additional questions:

I got it working last night, but when I loaded up my level today it hasn't worked :(. All I did was add new meshes to the entity, but never changed the interaction component. Have you noticed any bugs with it? Currently when i approach the interaction it highlights and asks for an input, but it no longer sends the signal. (an issue with the Pause schematic i assume) I checked the names within the interactionName and its the same.

Big question... in your tutorial you specify that the ownerTags should be that of the parent entity, but in the REDKit manual it says that the ownTag should be [PLAYER]. Any Thoughts on this?

Does the entity class matter when scripting the questInteraction?



I have some images attached.
 

Attachments

  • redkit inteaction 1.JPG
    redkit inteaction 1.JPG
    112.1 KB · Views: 260
  • redkit inteaction 2.JPG
    redkit inteaction 2.JPG
    77.7 KB · Views: 247
  • redkit inteaction 3.JPG
    redkit inteaction 3.JPG
    59.9 KB · Views: 301
Last edited:
I'm 100% sure that it should work - make sure that you set QEnableComponent script's shouldBeEnabled flag to true and your objectTag/componentName are correct.
 
I have updated my above response, due to the many questions I have. I hope you can help.

---------- Updated at 01:08 PM ----------

Ok well I found out the issue. When I changed the entity... the tags got reset in game and I never set them back.

Thanks for your help and I will try the Enable component now that it works again.
 
I'd suggest assigning a new tag for your object outside of the Enity editor and using this new tag in the Pause.

Big question... in your tutorial you specify that the ownerTags should be that of the parent entity, but in the REDKit manual it says that the ownTag should be [PLAYER]. Any Thoughts on this?
I guess it depends on the script - in case of QuestInteractionCondition Pause you should certainly use the tag of the parent entity.
 
Hi,

Sorry to answer to an old topic but my interaction doesn't work, I'm trying to interact with a body.

I did what Horn said and I have the interaction that appears on the body.
But when I use it, nothing happens.

If someone figured out how to make this work it would help, thanks.
 
Top Bottom