How do I add external jquery in construct2

Get help using Construct 2

Post » Mon Dec 15, 2014 4:47 am

Hi ,
I am working on the game for which I will require additional features. I need to parse one object from java in construct2. I need to add one external jquery for parsing that. Is it possible in construct2?

Thanks
B
4
Posts: 13
Reputation: 224

Post » Tue Dec 16, 2014 12:15 am

jQuery is already included in the Construct JS file. You should just be able to call functions from jQuery using the Browser > Execute JavaScript

We use AJAX responses in JSON format and let rex_rainbows Hash plugin parse it for us.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,415
Reputation: 4,824

Post » Tue Dec 16, 2014 8:43 am

Hi....Thanks....I have installed that plugin but I am not able to use it....I am loading Ajax.lastdata from URL "http://localhost:8082/SpringJsonOutput/student.json" and then I am using Load hash table from json property of plugin.....But I am not getting output in hashtable.....Is it the correct way of using it?
B
4
Posts: 13
Reputation: 224

Post » Tue Dec 16, 2014 7:29 pm

Yea, that should be correct. Here is an example from our game client:
1.png

We parse the keys into a separate Array then loop through that array to reference each Hash bucket.

You have to reference the Hash like this:

Hash.At("key.arrayIndex") for multidimensional Hashes. For us, we use a loop like:
For loopindex from 0 to keyArray.Width -1{
Hash.At(keyArray.At(loopindex) & ".0")
}
in order to access the 0th slot in the array stored at each key location. Or you can dynamically increment the array index to access other array slots in each key location.

See rex's post on his Hash plugin for more details on other implementations:
viewtopic.php?t=65765&start=0
You do not have the required permissions to view the files attached to this post.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,415
Reputation: 4,824


Return to How do I....?

Who is online

Users browsing this forum: Bootfit, brunopalermo, tarek2 and 7 guests