Jump to content

rayman

Community Newbie
  • Posts

    4
  • Joined

  • Last visited

Everything posted by rayman

  1. That was what was confusing me, I wasn't using any of my own code for this. Decided to re-download the code base as I've been working between two computers on this project. Must have done something wrong along the way as I had no problems with the newly downloaded clean build. Will now try and bring my code across and see what happens. Edit// Yup, it's now working in my code too. I don't think it's an elegant solution to getting data out I imagine, but as long as it works for the project I'm content with it as it is. One problem I had introduced was using creating an OnUpdate function in StatisticsTracker.js - for some reason this created padding around the value (rather than reporting the value on the console, it would print three lines 0, the value, 0 - debugger and my code would just pick up the initial 0 for whatever reason).
  2. Thanks, I've been meaning to look up how to print to console through the JS files. Didn't get console to work but below is the screen shot of when I used warn(msg) to print the wood gathered integer when it was being collected. Below, I can see the correct values (34, 35) hidden amongst the junk values which also seem to be increasing linearly. This is what I got from food and wood - stone and metal just seem to print no values, regardless of whether I'm collecting the resource or not. But from what I gather, this is how the StatusBars.js pulls the numerical information for the top of the screen? (And that is clearly working). So I don't get what I'm doing wrong, or what I need to be doing instead.
  3. Hello, Been working with the codebase for a while now for an interactive music project, have constructed what I need now to do the music-y bit but I'm at a loss with the data feed I'm getting out of StatisticsTracker.js. Am I right in thinking I can take data out of that file in real-time? I've been working under that assumption, but I've been rooting around the JS debugger and it doesn't seem to be reporting the right numbers. I've isolated it to resources gathered, specifically wood, and it seems to continually go up once the resource is collected for the first time in the game. In the attached screenshot, you can see I've collected about 20 wood but when I used a breakpoint (set to be triggered when IncreaseResourceGatheredCounter is called), but the variable resourcesGathered on the JS debugger is reporting 32. Also, food is reporting 160 which I hadn't collected, nor is it the starting value. I'm lost. Any help/guidance would be gratefully accepted. (Not massively sure why I'm getting those JS errors in the top left corner, they only appear when I add the breakpoint in).
  4. Sorry to bump an old topic but I wondered if there were any updates on this project? I'm working on something for my masters project (real-time/interactive video game music) which I believe requires similar access to the JS data through the C++ code With the other games I've worked on, I've passed data into a shared memory buffer, but I'm struggling to get my head around how to actually access the game logic from C++ (and from what I gather I can't simply pass the data into a buffer from the JS code). I'm trying to call ScriptInterface but I must be missing something, I studied the CmpAIManager at length but don't seem to be able to successfully call it myself without running into trouble. Thanks!
×
×
  • Create New...