Viewing the structure of a container during an event or iterating over its member names

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
Beatsaber
Posts: 2
Joined: December 20th, 2019, 11:06 pm

Viewing the structure of a container during an event or iterating over its member names

Post by Beatsaber »

In many events, there are temporary variables like $unit, $x1, $y1, and $weapon. For the purpose of debugging, I might find this useful - assuming it's even possible.

1. Is there a way to use WML and iterate over the temp variable and show the keys' names after the event ends? I don't seem to be able to copy the variable without necessarily knowing its exact structure. This would be relevant when using many custom keys for these "types" of structures.

2. Alternatively, is there a way to open the :inspect window while an event is occurring?
User avatar
octalot
General Code Maintainer
Posts: 786
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: Viewing the structure of a container during an event or iterating over its member names

Post by octalot »

2. You can put [inspect][/inspect] in your WML event.
Beatsaber
Posts: 2
Joined: December 20th, 2019, 11:06 pm

Re: Viewing the structure of a container during an event or iterating over its member names

Post by Beatsaber »

Thank you octalot, this is exactly what I was looking for!
Post Reply