...use dictionary correctly

Get help using Construct 2

Post » Sun May 26, 2013 8:50 am

Hi everyone,

working with my dev partner on a early test project. using the google app engine we have a project working.. we can pass data to it, but what we're trying to do now is use a dictionary.

testing it out we know there is 1 item out there because it shows up with a 1 in the .count but everything else we try seems to result in a 0 which means there is nothing out there. Our data never has a zero in it.. the two parameters are "content" and "success" content being where you enter your name..

the data is out there, we just can't seem to get the dictionary to load that data correctly.. any ideas? here is the project currently.


it's 3:47am here.. so if i left something out that would help please let me know! :)   questions like maybe, "do we need to make instance variables inside the dictionary? we tried that, but that didn't seem to help.

we just can't seem to get the data out of the dictionary trying numerous different approaches.

Posts: 854
Reputation: 5,810

Post » Sun May 26, 2013 9:03 am

I'm working with the poster of this thread. We've found the answer. The answer lies in the response object. You must specify which construct 2 datatype you want to dump your json data to. In our case we had to set a key of 'c2dictionary':True and set your game related data to an key 'data:{}'.

def post(self):
         self.response.headers['Access-Control-Allow-Origin'] = '*'
         # logging.info(self.request.get('name'))
         # self.response.out.write(self.request.get('name'))
         name = self.request.get('name')
         data = {

Posts: 1
Reputation: 153

Return to How do I....?

Who is online

Users browsing this forum: flemmig, g3nki, makkancs and 17 guests