[EDITOR] Variables Overwrite Problem

Report any bugs here or ask questions here!

[EDITOR] Variables Overwrite Problem

Postby YensLe » 2 October 2020, 08:04

As we all know variables are not copy and paste friendly at all as they tend to be tedious to work with based on copy and pasting the same thing over and over but due to variable's names if they are the same they'll overwrite one another which causes issues if only there was a way to solve that problem.

So, I'm just hoping this won't end up being an unnecessary post though.

So, as it is it's very great to have a way to copy and paste variables without worrying about them overwriting one another if you know what I meant, thanks.

YensLe
Cyber Grub [25]
 
Posts: 32
Joined: 26 September 2020, 08:12

Re: [EDITOR] Variables Overwrite Problem

Postby Nyove » 3 October 2020, 04:43

Hey YensLe,

You can actually copy variables and it will automatically rename it for you (preventing variable conflict issue).

To do that, place a decoration anywhere and change it's ID to the variable name you want to duplicate.
https://cdn.discordapp.com/attachments/ ... apture.PNG
In this case, the trigger utilises two variables: ~foo and ~foo2. So, I placed two decorations with ID of the respective variable names.
Note: The model of the decoration does not matter, I just don't want floating stones around my map.

Copy the entire triggerwork together with the decorations, and paste it somewhere else. Take a look at your triggers now.
https://cdn.discordapp.com/attachments/ ... apture.PNG
Sorry I had to provide the link instead of previewing it, the image is too wide.

You can delete all of the decorations after you finished your triggerwork. Make sure to keep account of all your variables before you copy and paste, or things can get real messy real fast. \:P

Best regards,
Nyove
Last edited by Nyove on 8 June 2022, 06:08, edited 1 time in total.
Proud to be part of something meaningful.
Need any assistance? Join the PB2 discord server at https://discord.com/invite/Bhe9rNz or raise a support ticket at https://www.plazmaburst2.com/support

Contact me on discord for quickest reply possible.

User avatar
Nyove
Falkok [250]
 
Posts: 255
Joined: 7 July 2016, 10:26
Location: Cicada 3301

Re: [EDITOR] Variables Overwrite Problem

Postby YensLe » 3 October 2020, 08:31

Wait, this is a feature already?

Why was it hidden from everybody's eyes?

Anyway, thanks!

YensLe
Cyber Grub [25]
 
Posts: 32
Joined: 26 September 2020, 08:12

Re: [EDITOR] Variables Overwrite Problem

Postby Yex » 16 October 2020, 02:06

Thanks, Nyove for making this tutorial for other level developers to know that object's ID names are far more useful then we first thought.

You can use #actor*1 for variable 'A' which is usually set to player-initiator slot you can make it equal to #actor*1 instead of using numbers which makes it even more easier for copy and pasting and choosing which specific object it is and yes it works as I have tested this myself in YensLe.

Now I really want to die. Just to get out of this embarrassment.
Don't talk to me.
User avatar
Yex
Civil Security Lite [100]
 
Posts: 103
Joined: 13 May 2020, 22:07
Location: Hell

Re: [EDITOR] Variables Overwrite Problem

Postby Nyove » 17 October 2020, 05:33

Hey Yex,

Thanks for bringing up this feature. I was aware that IDs will be translated into numbers when you showText(), but I was not aware that the number is actually the slot of the player, and that you can use it in Continue If trigger actions. It seems like all objects with IDs have a slot, not just players.

I will try to experiment more with these pseudo-variables IDs and see how we can further utilise it.
Thank you for sharing this once again.

Best regards,
Nyove
Proud to be part of something meaningful.
Need any assistance? Join the PB2 discord server at https://discord.com/invite/Bhe9rNz or raise a support ticket at https://www.plazmaburst2.com/support

Contact me on discord for quickest reply possible.

User avatar
Nyove
Falkok [250]
 
Posts: 255
Joined: 7 July 2016, 10:26
Location: Cicada 3301


Return to Bug Reporting, Help & Support

Who is online

Users browsing this forum: No registered users