philzeleski's Forum Posts

  • Awesome. Thank you. Sorry, it's been awhile. I think it might be time to go back and re-read the manual if I forgot how to do something so rudimentary.

  • Hi,

    I seem to remember there being a way to create a particle generator at another sprite's location as an action. However, I don't see that option any more. Can anyone fill me in on what I am doing wrong?

    Thanks,

    Z

  • That did the trick. Figuring out how to use "Trigger Once" was the fundamental knowledge I was lacking. Thank you.

    Z

  • Hi all,

    Here's what I have in my project:

    1 Dice Sprite with 6 animation sets - Default, Randomizing and 4 different results. Die has a variable 1-10, representing the 10 sides of the die.

    1 Button

    1 Global Variable - It has three used values "Waiting", "Rolling" and "Stopped"

    Here's what I am trying to do:

    1) Sprite is in its "Default" animation state and Global Variable is in its "Waiting" state when the project starts.

    2) User clicks on the button and the Dice begins to loop its "Randomizing" animation, and Global Variable is set to "Rolling". 3 seconds go by and the following happens:

    --Dice Variable is set to a random value

    --Dice Randomizing Animation stops

    --Dice animation changes to one that matches up with the dice variable:

    ----e.g.: If the dice variable is 1, it results in an animation appropriate to that face.

    Here's what's actually happening:

    1) Sprite is in default state

    2) I click the button, the randomizing animation plays because I set the global variable to tell the animation to play "Randomizing" when the global variable is set to "Rolling"

    3) 3 seconds go by... and despite me telling the Global Variable to be "Stopped" and there is a condition checking the global variable as "Stopped" and a check for each possible (1-10) result of the Sprite Variable some problems occur: the Global Variable does correctly get set to "Stopped", but the action that rolls a random value for the Sprite's var, (which happens upon pressing the button after the 3 second wait) gets rolled several times before ultimately settling on a value.

    What am I doing wrong? I think there's some fundamental lack of knowledge on my part and hope you all can help!

    Thanks,

    Z

  • One (hopefully) final question. Is there a way to format text in an expression?

    Here's what I am trying to do specifically:

    Here's my expression: "Requirements: " & XML.StringValue("/rows/row[" & SkillBox1.NodeValue & "]/Requirements/text()") & newline

    I'd like the first piece of text "Requirements: " to be bold. Is that possible?

    Thanks,

    Phil Z

  • I could kiss you. *ahem* But, I'll refrain from doing so. Seriously though, thanks for the help. I have been stumped on this for a couple of weeks now. You've been tremendously helpful.

    Regards,

    PZ

  • Awesome, that works great. I do have a follow up question. Is there a way to replace the [1] with a check on an Instance Variable?

  • Hi all,

    I am trying to have a project load an XML project file and then be able to parse data from that XML data. So far so good it seems. I've read the manual, I've read all the XML tutorials, I've read up on XPATH. What I'd really like is if someone could could show me where I am wrong combining Construct 2 expressions with XPATH. Specifically, I am trying to call up the first string with a specific tag.

    Here's my project

    I am using the expression XML.StringValue("/rows/row/PowerName[1]") and I am immediately noticing two issues: Only the first word in the string is appearing, if I replace [1] with [2] nothing loads despite there being 3 items. A little help would be much appreciated.

    Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm still pretty stumped and have started two other threads. One to focus on finding a solution with XML and another for JSON. Neither have yielded fruit unfortunately. So, I could really use some help if someone has time.

    If someone could provide an example of how to call up a specific string of data in an XML file or JSON file that would be amazing. Here's been my flow so far...

    1) Create XLS file with a simple spreadsheet.

    2) Use this site to convert it into XML, JSON, whatever...

    3) Plug this new file into Construct 2 as a project file.

    Here's where I currently am with my project.

    I am happy to swap the data from JSON to XML. That's not a problem. I'd just like to call up specific pieces of data. Like the first string with a specific tag. If anyone could give me an example of how to do this I would be eternally grateful.

    Regards,

    Phil

  • Do you know of a way to parse XML in the same way. Like referring to the first of a given tab?

  • Hello,

    I'm working on a Diablo II style skill tree prototype and running into problems loading data from either an XML file or a JSON file. Here's what I am trying to do:

    1) System: On start of layout/Ajax: Request .json project file

    2) Ajax: On load of .json file/Dictionary: Load from JSON string "json project file name"

    3) Mouse: On left click on sprite object/System: Set Global Variable to match Instance Variable on the sprite object.

    4) Have the various text objects load specific lines of data from the JSON data. Below is the JSON data I am loading:

    [{"PowerName":"Heavy Slash","Requirements":"Long Sword","Keywords":"Sword, Long Sword, Technique, Focus Builder, Accurate, Mandatory","Power":"1(W),Special","Type":"Technique","PlusResource":"+1 Focus","MinusResource":"N/A","Target":"Single","Range":"1","Splash":"N/A","Resist":"Physical","Duration":"Instant","Cooldown":"At Will","Description":"Accurate: +5 Precision. Deals 1*Weapon Damage to target. Builds 1 Focus. If caster has no Focus at time of usage, damage is boosted to 1.5*Weapon Damage."}, {"PowerName":"Runthrough","Requirements":"Long Sword","Keywords":"Sword, Long Sword, Technique, Focus Consumer, Accurate, Mandatory","Power":"1(W), +.5(W) per Focus","Type":"Technique","PlusResource":"N/A","MinusResource":"-All Focus","Target":"Single","Range":"1","Splash":"N/A","Resist":"Physical","Duration":"Instant","Cooldown":"At Will","Description":"Requires at least 1 Focus, consumes all Focus. Accurate: +5 Precision. Deals 1*Weapon Damage (plus .5 Weapon Damage per Focus consumed). Reduces the target's Toughness by 10 (plus 2 per Focus consumed) for 2 rounds. Actionless if user has 3 or more Focus."}, {"PowerName":"Defensive Strike","Requirements":"Long Sword","Keywords":"Sword, Long Sword, Technique, Focus Builder, Accurate, Offhand, Actionless, Accurate","Power":"1(W)","Type":"Technique","PlusResource":"+2 Focus","MinusResource":"N/A","Target":"Single","Range":"1","Splash":"N/A","Resist":"Physical","Duration":"1 round","Cooldown":"2 rounds","Description":"Accurate: +5 Precision. Deals 1*Weapon Damage to target. Builds 2 Focus. Boosts Toughness by 10 (plus Sword Proficiency Level) until end of next round."}]

    I am trying to call a specific "PowerName" text (for example, the first one) into a text object.

    You can see how far I've gotten by looking at this this project.

    TL;DR, how do I load up a JSON data file into a dictionary and then call up a specific bit of data from that JSON file?

    Thanks in advance, I am pretty stumped!

    Phil

  • Sorry to bump this thread, but I am still hoping to get a response.

  • Another question, once I've resolved the issue where I can pull up the whole name of an entry how do I change the display text in case I want to append text to what I am querying?

    For example. I want to pull up the contents of the first Requirements tag, but I want to display it as "Requirements: (contents of the first requirements here)"

    Thanks in advance,

    Phil

  • So, I've made a little progress and have been studying up on XPath. However, I haven't had much luck. What I'd like to do is to set text on a text object to be a particular line. For example, if I click on skill box sprite object 1 I want to set a text object to the first power name. So I tried this:

    XML.StringValue("/rows/row/PowerName[1]")

    What I end up with is the first word of the power name instead of both of them. What am I doing wrong here?

    Regards,

    Phil

  • Thank you Magistross. At first I was confused what you meant by not being able to use spaces and symbols. But, I get it now. That's only in tag names. I'll play around with your example and I'll re-post if I have questions. Thanks again.

    Regards,

    Phil