Forum rules - please read before posting.

Items pop up before Inventary

edited April 2014 in Technical Q&A
Hi again ;)

I was wondering if is possible after u pick an item to have a custom pop up (3d or 2d) to emphatize better what did u took...

I'll try to explain better: a piece of paper for example. I go near the piece of paper. I select "take it" then before the piece of paper goes into the inventary a pop up like " u just got this piece of paper".

Is that clear?

Thx in advance, cheers ;)

Comments

  • You'd need a custom script for this - although some basic functionality could be implemented in AC, you'd want this pop-up to be very specific to your game.  I'd recommend writing a script that contains a function to display the popup, which takes the name of the inventory item as a string in it's argument.  You could then use the Object: Send message Action to call this function, and give it the name of the item as a custom parameter.
  • Ok thx...u or someone in this forum can say to me where can I find something like that?
  • edited April 2014
    What I'm doing wrong?

    So i created a GUI texture and called it PaperPopup and set the texture to none...after I found a script called paperpopup in javascript like this:
    function Start() { Hide(); }
    function Hide() { guiTexture.enabled = false; } function Show(paper : Paper) { if (!guiTexture.enabled) { var t = paper.popupTexture; var rect = Rect( -t.width/2, -t.height/2, t.width, t.height ); guiTexture.pixelInset = rect; guiTexture.texture = t; guiTexture.enabled = true; } } function OnMouseUp () { Hide(); }<<p>then I apply this script to the gui texture...

    then I have this script named paper:

    arpopupTexture : var popupTexture : Texture2D;
    private var paperPopup : PaperPopup;

    function Start () {
    paperPopup = FindObjectOfType(PaperPopup);

    if (popupTexture == null) {
    popupTexture = renderer.material.mainTexture;
    }
    }

    function OnMouseDown () {
    paperPopup.Show(this);
    }

    applied this to the item

    now in the action list I do Object send message but seems I can't call this function...advice?

  • I can't read your code example. Are you able to edit your message and remove all HTML tags?
  • The variable you can send with using the Send message Action can only be a basic type, like an integer, and not a custom class, like Paper.  You'll need to edit your Show () function to accept an integer instead.
  • :( someone good at coding can fix the script for me? Since I don't understand integer and other stuffs
  • If you can't do the complicated stuff, stick to the easy stuff or learn how to do the complicated stuff.
    Please don't expect others to write your code!

    Chris already politely pointed you in the right direction ...
  • I didn't say  something like : someone do it now...

    I just asked kindly if someone good at scripting can fix the script since I'm not able to....I don't think ur answer was very nice...I think it was a very stupid answer
  • So after a suggestion of 2fingers (thx a lot mate) I went with this trick...I post this if someone need this triyng to be more specific as possible since I was going crazy to figure out a solution!

    Example Diary Pages:

    I created a new menu voice called DiaryPage1 with this parameter:

    Start game locked off UNCHECKED
    Appear Tipe MANUAL
    Pause game when enabled CHECKED

    After that I created 2 elements in the menu. The first one called Page, the second one called Resume.

    The first element parameters are like this:

    Name: Page
    Visible: Checked
    Button Text: Empty
    Click Type: custom script (just to leave it blank)
    Font etc etc: doesn't matter since we don't have text
    Higlight texture: empty
    Sounds: ur choice
    Background texture: finally THE DIARY PAGE
    Position: Aligned
    Size: Up to u :)

    The second element parameters:

    Name: Resume
    Visible: Checked
    Button Text: Resume
    Click Type: TURN OFF MENU
    Font etc etc: up to u
    Higlight texture: empty
    Sounds: ur choice
    Background texture: none
    Position: Aligned
    Size: Automatic

    Now we have this piece of paper on the ground with a hotspot on it...and now is easy. Call trought the hotstpot the interaction u need then inside the interaction use:

    actions: Menu Change State
    Change Type: Turn On Menu (DiaryPageA)
    Fade: Up to u
    After running: continue

    this is basically how it works...when the character does the interaction u'll have a popup with the piece of paper and button resume near it to unpause the game...u can use multiple buttons to go trough a series of pages for example...just play around with the settings and u'll find out the best solution for ur needs.

    Thx again 2finger for the basic idea :)

    P.S. For ChrisIceBox: u think this trick is very memory consuming for mobile etc etc or is good?

    w8in replies cyas :)
  • I'm happy you find my suggestion useful!

    I think the Menu Manager is a gold mine if you learn how to use it well! Chris should make a manual only for that, lol!

    Ciao!
  • If you're making a diary, you're better off using the Journal element instead.  You can use that to store all of your pages in one Menu - and use the Menu: Change state Action to add pages to it as you go.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.