[Plugin] Query String

Post your completed addons to share with the community

Post » Tue Oct 04, 2011 8:52 pm

Who would have thought that even I could do it?! Here's my first C2 plugin Query String (alpha).



It retrieves query strings added to your game's url through expressions, simple as that.

To clarify:

www.domain.com/yourgame/index.html?user=gamer&level=final

Now in Construct we can get these arguments by using the Query String object's expressions. QueryString.Get("user") will return "gamer" in this case.

How is this useful? You could think of it sort of as a command line method for C2 games. For example you could add ?debug=true to your game's url to start it up in a special debug mode.

I for one made this plugin because I wanted to pass whole levels in form of long strings directly to the game for an experimental project.

Also note that this doesn't work in preview mode, because apparently you can't add query strings to the preview localhost url. You will have to export the project in order to use this.

Download Query String plugin (alpha)

More features will eventually be added. Use at your own risk.
Parts of the javascript used in this plugin by JohnKrutsch, found through Google. Thanks!
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Tue Oct 04, 2011 8:55 pm

Pretty interesting idea.
Grats, and thanks.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Tue Oct 04, 2011 10:32 pm

Nice call indeed.
This plugin will be very useful, thanks a lot PixelRebirth.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Tue Oct 04, 2011 10:49 pm

I'm planning on using WebStorage to save game state so when a user quits the game they will (hopefully) be able to play offline on a mobile device.

I really like the plugin you've generated because it will allow me to build in overrides to the current WebStorage data to send commands to the game like change the current level (i.e. Layout), clear the cache (WebStorage kvp's) and control the WebStorage in general via the URL. Very cool addition.
B
8
S
3
G
4
Posts: 11
Reputation: 2,537

Post » Wed Oct 05, 2011 1:02 pm

just what I needed! Awesome!
B
12
S
5
G
5
Posts: 80
Reputation: 3,572

Post » Thu Jun 07, 2012 8:25 am

If any one variable is not in query, then the application stops responding
--AquaBarbus2012-06-07 08:36:53
B
13
S
2
Posts: 16
Reputation: 1,622

Post » Mon Mar 25, 2013 4:10 pm

Where do I install these files? and It's an option like ajax, or function?

Sorry, I'm new to this. but I want this functionality.

PS, great work! :)
B
12
S
3
G
3
Posts: 13
Reputation: 2,628

Post » Mon Mar 25, 2013 5:54 pm

Sounds great but would this work in CocoonJS, as that doesn't have a url if i'm not mistaken?



Note. This is my 100th post, woo badge :)
B
24
S
11
G
5
Posts: 140
Reputation: 5,004

Post » Thu Mar 28, 2013 1:40 am

Don't use this plugin guys, it may cause problems. C2 supports query strings by default for a while now, so this is obsolete in any case.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445


Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest