Fastest way?

Get help using Construct 2

Post » Sun Jan 04, 2015 7:58 pm

Is there a way to do a find and replace? In the events sheet, lets say there is a set text to global variable "count 1". If I copy that Events Sheet to another, the Global Variable would go from "Count 1 to Count 2, but all the references to the GV would be 1. Anyway to do.. find "Count 1" replace with "Count 2" thx
B
9
S
2
Posts: 104
Reputation: 1,098

Post » Sun Jan 04, 2015 8:06 pm

Not as such.

You maybe able to do it a hacky way by doing a "Save as project...". Which saves it as multiple files. Close C2. Then opening the event sheet xml with a text editor. Do a search and replace. Save and open in C2.

P.S If I helped you then please return the favor and support me by liking me on facebook -> http://www.facebook.com/thewyrm
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542

Post » Sun Jan 04, 2015 8:10 pm

ahhh... let me check this. I will like you on fb, even if this does not work. thx
B
9
S
2
Posts: 104
Reputation: 1,098

Post » Sun Jan 04, 2015 8:27 pm

hmm.. i thought this would have been it. I'm not finding any reference of the GV's .. damn
B
9
S
2
Posts: 104
Reputation: 1,098

Post » Sun Jan 04, 2015 9:47 pm

You should be able to see it. Look at my example.

<?xml version="1.0" encoding="utf-8" ?>
<c2eventsheet>
<!--All the 'name' attributes are ignored by Construct 2 - they are there for readability only.-->
<name>Event sheet 1</name>
<events>
<variable constant="0" name="GlobalVar" sid="9714360519691366" static="0" type="number">0</variable>
<event-block sid="7018329122331523">
<conditions>
<condition id="-2" name="On start of layout" sid="299500794865517" type="System" />
</conditions>
<actions>
<action id="0" name="Set text" sid="7509042542778953" type="Text">
<param id="0" name="Text">GlobalVar</param>
</action>
<action id="1" name="Set size" sid="4423238529848415" type="Array">
<param id="0" name="Width">10</param>
<param id="1" name="Height">1</param>
<param id="2" name="Depth">1</param>
</action>
<action id="2" name="Set at X" sid="2044702159796748" type="Array">
<param id="0" name="X">0</param>
<param id="1" name="Value">&quot;Question 1 text&quot;</param>
</action>
<action id="2" name="Set at X" sid="3481080486553087" type="Array">
<param id="0" name="X">1</param>
<param id="1" name="Value">&quot;Question 2 text&quot;</param>
</action>
<action id="2" name="Set at X" sid="9166454218324226" type="Array">
<param id="0" name="X">2</param>
<param id="1" name="Value">&quot;Question 3 text&quot;</param>
</action>
<action id="2" name="Set at X" sid="2295161434386167" type="Array">
<param id="0" name="X">3</param>
<param id="1" name="Value">&quot;Question 4 text&quot;</param>
</action>
<action id="2" name="Set at X" sid="3591827090944929" type="Array">
<param id="0" name="X">4</param>
<param id="1" name="Value">&quot;Question 5 text&quot;</param>
</action>
<action id="2" name="Set at X" sid="3335473294898624" type="Array">
<param id="0" name="X">5</param>
<param id="1" name="Value">&quot;Question 6 text&quot;</param>
</action>
<action id="2" name="Set at X" sid="8324247311191332" type="Array">
<param id="0" name="X">6</param>
<param id="1" name="Value">&quot;Question 7 text&quot;</param>
</action>
<action id="2" name="Set at X" sid="9071752183104546" type="Array">
<param id="0" name="X">7</param>
<param id="1" name="Value">&quot;Question 8 text&quot;</param>
</action>
<action id="2" name="Set at X" sid="4933738152892325" type="Array">
<param id="0" name="X">8</param>
<param id="1" name="Value">&quot;Question 9 text&quot;</param>
</action>
<action id="2" name="Set at X" sid="7629973087529539" type="Array">
<param id="0" name="X">9</param>
<param id="1" name="Value">&quot;Question 10 text&quot;</param>
</action>
<action id="0" name="Set text" sid="8331962340760189" type="Text">
<param id="0" name="Text">Array.At(floor(random(10)))</param>
</action>
</actions>
</event-block>
<event-block sid="8630094855078521">
<conditions>
<condition id="6" name="On object clicked" sid="4589826014420757" type="Mouse">
<param id="0" name="Mouse button">0</param>
<param id="1" name="Click type">0</param>
<param id="2" name="Object clicked">Text</param>
</condition>
</conditions>
<actions>
<action id="0" name="Set text" sid="8245938615069997" type="Text">
<param id="0" name="Text">Array.At(floor(random(10)))</param>
</action>
</actions>
</event-block>
</events>
</c2eventsheet>

As you can see my GV is called GlobalVar and is created at the top and then specified in a "set text" action.
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542

Post » Sun Jan 04, 2015 11:20 pm

ok..weird. but it works. Not sure what was happening before, but yes, I can so a S&R ..thx.
B
9
S
2
Posts: 104
Reputation: 1,098


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 3 guests