Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(new/resource): basic first resource #429

Closed
wants to merge 1 commit into from

Conversation

PsychoShock
Copy link
Contributor

This pull request enhances the documentation for the first resource by expanding coverage, improving organization, and clarifying terminology. Additionally, it includes an extra section at the end of the module with supplementary materials and further reading suggestions for deeper learning.

@ESK0
Copy link

ESK0 commented Jun 5, 2024

Imagine deleting true comments :) I really didnt expect that... Now lets create whole docs by LLM

Let's break this in part:
#### 1. Checking if Code is Executed by a Player:
```lua
if not (source > 0) then return end
Copy link

@TheIndra55 TheIndra55 Jun 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if source == 0 then return end


At the bottom of your `mymode_client.lua`, add this code:
## Client resource
Copy link

@TheIndra55 TheIndra55 Jun 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Client script


And, guess what, it's actually {{% native_link "REGISTER_COMMAND" %}}! Click that link, and you'll be led to the documentation for this native. It looks a bit like this:
The client-side files, located in the `client` folder, control interactions visible to players and handle rendering, while also enforcing security measures and processing that cannot be tampered with by players.
Copy link

@TheIndra55 TheIndra55 Jun 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This last line is a bit weird, the client shouldn't enforce security measures and can be tampered with.

```lua
if not information then return end
```
This line serves as a crucial validation step, ensuring that the code receives a valid parameter sent by the server. Detecting and handling invalid parameters can be instrumental in identifying and thwarting cheating attempts. For further insights on advanced techniques, refer to the [advanced part](/content/docs/scripting-manual/introduction/creating-your-first-script-extra.md).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would a value sent from the server help in identifying cheating attempts?

Goal is to make user be able to understand how to create his first resource and prevent some first errors.
@AvarianKnight AvarianKnight added the waiting for review PR needs to be reviewed label Aug 7, 2024
@AvarianKnight
Copy link
Collaborator

AvarianKnight commented Aug 11, 2024

I don't think this is an improvement over the current documentation.

I added this to the tracker though, because these do need to be rewritten.

In the future these scripting examples should be completely rewritten and should preferably be a step-by-step in making an example resource like capture the flag.

@PsychoShock
Copy link
Contributor Author

In the future these scripting examples should be completely rewritten and should preferably be a step-by-step in making an example resource like capture the flag.

Well this is exactly having a step-by-step doc. It also handles docs having beginer guide + more advanced. If it will be rewrittent in the future it's fine, but closing this instead of the actual one make no sense imo. This is a way more complete guide + up to date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for review PR needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants