hertles's Recent Forum Activity

  • Thank you so much! is just what I needed.

  • The xml text was much more organized when I sent it. I could try to write again if you guys need it. but is basicly the image below:

  • I still use construct 2 and I'm having a hard time learning how to use xml.

    I'm trying to learn how to make a twine-like, visual novel/dialogue and wanted to be able to change the game language, then I found out that xml would be the way.

    But I still can't understand how to use it. I watched some tutorials, but none of them is specifically for what I want, and they give me just too much loose information that makes me overwhelmed. I don't understand what do I do after,"load XML from AJAX.lastdata" How do I set a text object to a specific text on the xml file?

    I asked ChatGpt to make me a simple story in xml for maybe you guys make some capx template on how I could do this, he made me this:

    <?xml version="1.0" encoding="UTF-8"?> <game> <scene id="intro"> <text>Welcome to our story! What would you like to do?</text> <options> <option text="Explore the forest" target="forest" /> <option text="Visit the village" target="village" /> </options> </scene> <scene id="forest"> <text>You venture into the dense forest. It's quiet... too quiet. Suddenly, you hear a rustling in the bushes.</text> <options> <option text="Investigate the noise" target="wolf_encounter" /> <option text="Run back to safety" target="intro" /> </options> </scene> <scene id="village"> <text>The village is bustling with activity. You see a market and a tavern.</text> <options> <option text="Visit the market" target="market" /> <option text="Enter the tavern" target="tavern" /> </options> </scene>

    I don't understand completely for what is the "scene id" , but I have some idea. I just don't know how to apply it in the game. Should I make it a variable? or what?

    I have so many doubts.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hahaha I think It's a better idea ! haha, I'll try, thank you very much!

  • Just figured it out. It was that I was not putting the local variables as "static"

  • I think you understood. I did not know about local variables. I'm using it now just to track the quantity of each text object. But there is a problem. The local variables value don't get subtracted when I click the text object. It works with global variables and I don't know why.

  • I'm prototyping this kind of visual novel. I wanted that in some part of the game, there were option of picking up itens in text format like "take sword [1]","take salt [10]", "take piece of bread [3]. And when the text objct was clicked, it would subtract the quantity of the "item", and when it was 0, the text object would disappear.

    I'm ok with adding the item to the inventory which is an array

    but I don't know how I would quantify the itens around the game. Let me explain

    For performance reasons, I've only created 4 text objetcts that could be clicked as a item. And I would like that this text object would "carry the Id" and quantity of every item in every part of the game (without me coming back to the place, and the item was back there)

    I tought about using array to carry the itens quantity of each scene. But I would have to set a xy value for each item in every scene. So I was wondering if any of you guys have a better way to do this.

    I'm not the best at using construct, so I'm just searching for a superficial explanation of how I would have to do this if is too complex. Don't mind me if I don't understand your answer. I know an inventory system and item system can be very complex, but I'm trying to make one as simple as possible for learning purposes.

    Tagged:

  • Yeah, I mistyped... I will test it out, thanks!

  • Don't mind me if I do, but I'm using c2 free version. So I have to insert the values to the array manually.

    at the moment, I'm trying to make an inventory with text objects. I wish to make them show as:

    - Salt 0 10$ 1kg"

    I setted the array values like this:

    -At layout start

    - set value at (0,0) to Salt //name of the item 1

    - set value at (0,1) to 0 // quantity

    - set value at (0,2) to 10 // price

    - set value at (0,3) to 1 // weight

    - set value at (0,0) to Food //name of the item 2

    - set value at (0,1) to 0 // quantity

    - set value at (0,2) to 5 // price

    - set value at (0,3) to 5 // weight

    And so on...

    to set the text object I used the "array.at" like this:

    set text to: "-" &array.At(0, 0)& " " & array.At(0, 1) &newline& array.At(0, 2) & "$ " & array.At(0, 3) & "kg"

    And I did this with both items (I wish to create more)

    It worked, but it seems that this is very inefficient method to set text. Does anyone know an expression, or a way that I can organize the array to make it better?

    I tried to use expressions like array.curX or curY or Loop index. But to be honest, I don't really understand them enough to make them work. But somehow I THINK that is the solution.

    Tagged:

  • I'm think this is the stupiest question I made here, but here's the problem.

    I have 3 objects

    -Night mask (a black sprite I use to give a night effect)

    -Character sprite animation

    -Stars background

    I want the Character object to be behind the Night mask, and the stars should be in the layer behind.

    The problem is that I also want the stars to have It's original colours (white) But the night mask makes it grey.

    I'll try to explain better sending a image on what I tried mainly.

  • You can use a combination of 'on created' and then as an action either put a wait or use timer behaviour. You can toggle ability to rotate with a variable, so rotate clockwise only while var=1, so the object initially has var=0 then after the wait or the timer you set the var to 1.

    It worked, thank you!

  • I'm trying to do some kind of clockhand. I managed to make it rotate using "rotate clockwise" but it does not wait to rotate. I wanted to make it to when created, wait 1 second, and starts spining.

    Tagged:

hertles's avatar

hertles

Member since 10 Jun, 2023

None one is following hertles yet!

Trophy Case

  • 1-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

4/44
How to earn trophies