Request: Text Notepad for Events Reference

Discussion and feedback on Construct 2

Post » Sat Feb 23, 2013 11:54 am

As construct2 projects get more complex and you are using many constants and arrays to reference data (for example), it would be good to be able to launch "post-it" type windows outside the editor that can hold either text or a render of the events - You can only copy paste event or variable lines in the editor.

The problem is that event editing is modal. So you have to remember the global variables and constants when using them - Not always easy for the best of us.

I'm finding myself doing screen grabs and pasting them in to documents so that I have a reference alongside the event code I'm writing. A bit of a faff (perhaps an alternative is to get a text render equivalent in the clipboard?).

So, some way of being able to copy/paste or reference variables and function definitions when editing an event would be damned useful (unless I'm missing an intellisense keyboard trick somewhere).
B
13
S
2
Posts: 27
Reputation: 1,899

Post » Sat Feb 23, 2013 12:10 pm

why not using comments, you can put one right before/after the function you're using to help you remember what it does

danuyos2013-02-23 12:11:23
Image
B
42
S
11
G
5
Posts: 269
Reputation: 10,880

Post » Sat Feb 23, 2013 12:44 pm

Comments for the win :) You can hit Shift+Enter to enter comments on a new line in same comment box too.
B
24
S
11
G
5
Posts: 140
Reputation: 5,004

Post » Sat Feb 23, 2013 2:10 pm

You can't copy paste const / event definition lines in to a comment block. I don;t see how that helps (quickly). To put this in to some perspective. I'm using arrays as the closest thing I can find to a data structure (perhaps object graphs are another feature request?). Anyway, to make array handling more readable I use constants to reference array indexes. That way, when you want to introduce a new property, you haven't got to go an rehash indexed look-ups. Event lines like...

> set rank to Ranks.At(Player.At(PA_RANK),RA_RANK_NAME)

(In the above example, trying to simulate object instance and property lookup, the first array index is equivalent to an object instance and the second the property I want). I know I could disappear down a customer plug-in route for my own object graphs, but I quite like trying to use the tool native as supplied.   

As you can probably guess, you end up with a long list on constants for array indices to mimic field references. If you want to re-jig the array entries, you change the constant.

Anyway, I think the modal editing of events does make obfuscation approaches like this an act of good memory. Another alternative may be to list constants in the objects window. Anyway, a request / suggestion.Duckocide2013-02-23 14:14:28
B
13
S
2
Posts: 27
Reputation: 1,899

Post » Sat Feb 23, 2013 2:34 pm

I'm not sure why you're having trouble with that, because you can use the expressions panel to see a list of all variables you can use, and you can also set a comment on individual variables which is also displayed beside the variable. Doesn't that do what you want? Combined with ordinary comments (press Q), surely you can have comprehensive documentation all through your project? Failing that, some notes in NotePad couldn't hurt.

Alternatively you might want to use the Dictionary object instead of Array. If you're looking up the rank name associated with a number or code, that's much better suited to Dictionary lookups than Array.Ashley2013-02-23 14:35:41
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,574

Post » Sat Feb 23, 2013 3:28 pm

Cool - How can I get the expressions panel to display constants, all I see are objects?

I do have documentation throughout the project, but the globals (constants) are at the top and the functions et al down the bottom.

Your suggestion on notepad is exactly what I have suggested except it would be good if you could paste copied events in to notepad - I can't.

I am using dictionaries for some data look-ups, but the data for the game is held in tabulated arrays (It's a trading game). I had toyed with the idea of dictionaries with compound keys for data look-ups. I might go back to this. I just thought arrays and constants would be quicker given that the dictionaries will end up quite large (cities x commodities x properties) and continuous market simulation ending up somewhat laboured (compared to a quick numerical array index look-up).

Just a thought Ashley - Can you get a text representation of variables and events in to the clipboard for pasting outside construct2? Might even help with people supplying issues / helping answer questions without uploading capx's
Duckocide2013-02-23 15:42:17
B
13
S
2
Posts: 27
Reputation: 1,899

Post » Sat Feb 23, 2013 4:10 pm

All variables are listed under the System object.

Unless you're reading/writing 100,000 elements per second, the performance difference between Array and Dictionary is probably not important.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,574

Post » Sat Feb 23, 2013 4:16 pm

D'oh!... Thanks :)
B
13
S
2
Posts: 27
Reputation: 1,899


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 14 guests