初學者提問 how to paste code into Workshop?

I found several articles teaching how to achieve specific functions
The answer to the article gives a string of code
Some I can figure out in the game interface
some don’t
I would like to ask how to represent these codes in the interface of the game

1
Teleport(Event Player, Add(Position Of(Event Player), Multiply(Facing Direction Of(Event Player), 10)));

This code I typed in the game is like this:
Teleport(Event Player,Position Of(Event Player)+(Facing Direction Of(Event Player),*10)

Although the function of this line of code is the same as the original one, I also follow this line in the game, but the code that appears at the end is different. Should I look outside the brackets first?

2
{
Set Player Allowed Heroes(Event Player, Filtered Array(All Heroes, Current Array Element != Hero Of(Event Player)));
Reset Player Hero Availability(Event Player);
}
}

I can type the first half of this code again but after !=
I don’t know how to use it

Where and when you use != ? It would be appreciate to see the full part of the code u try to copy and paste from a text editor. As long its not an entire Rule you copy, make sure in the interface editor in the game you need to add a placeholder rule, then if you copy and paste actions you’ll see within the action list, some buttons one of these denotes Paste, press it and the actions you copied from a text editor to your clipboard should paste in without any issues, same for the conditions. Overwatch detects automatically the syntax in the global enviroemnt clipboard, so copying and paste in entire rules is even more faster or convenient.

2 Likes

Thank you for your answer, I understand the meaning of the first paragraph, I need to find the corresponding button in the grammar, but I just can’t find the option to connect them before asking; I don’t even understand the second paragraph, You said you can copy and paste other people’s grammar? I have found this button but at most I can only copy and paste the game code completed by others,

No other people’s code of a workshop mode, the scripts, the building blocks literally what you posted in the OP (your entry post). To explain a bit further, we can copy and paste the building blocks, thats what actually is referred to workshop code or coding, not the share code. The buttons i mentioned are the provided helper tools within the actual workshop editor not in the text editor nor presented in grammar. Yes you can copy paste from the workshop editor into any text editor back and forth even code snippets others provide, but pay attention to published code snippets or in your words published grammars on some internet sites and here on the forums some are posted with embedded html code, so copy from those sites will not work since the workshop cannot interpret embedded html smybols and will treat is as non workshop code syntax, or its outdated syntax from over a year the workshop got some changes since the code you want to copy into the workshop editor was published. And still the question is open where does the != symbols occure in your code you found on mentioned article or in your OP. since at this point below

You said you struggle. With what excactly? At this point it doesnt seem to be a copy paste issue.

2 Likes