GameMaker Studio 2.3 - SCRIPTS HAVE CHANGED!

30242
82
1094
04.09.2020
Shaun Spalding

Shaun Spalding

22197218
142000
417
14.08.2006
GB
Описание видео:

TL;DW: Scripts used to *be* functions but now scripts simply *hold* functions. You can put functions anywhere now, but if they're in scripts they're global. You can name your arguments now. Argument0 etc still works. So does script_execute. More details directly from YoYo: 🤍help.yoyogames.com/hc/en-us/articles/360005277377 HAVE FUN. ▶ Support my work: 🤍🤍patreon.com/shaunjs

Кадры из видео
GameMaker Studio 2.3 - SCRIPTS HAVE CHANGED!
GameMaker Studio 2.3 - SCRIPTS HAVE CHANGED!
GameMaker Studio 2.3 - SCRIPTS HAVE CHANGED!
GameMaker Studio 2.3 - SCRIPTS HAVE CHANGED!
Тэги из видео
Комментарии пользователей:
n sixties 4
2022-02-18 23:50:05

Hey, I'm not sure how var works in scripts

Theoshore
2022-02-18 13:04:01

i did this and before my little character would move around but doing this they won't move anymore

arniehgk
2021-09-08 20:33:40

function PlayerStateRoll(){

//Movement
hSpeed = lengthdir_x(speedRoll, direction);
vSpeed = lengthdir_y(speedRoll, direction);

moveDistanceRemaining = max(0, moveDistanceRemaining - speedRoll);
var _collided = PlayerCollision();

// Update Sprite
sprite_index = spriteRoll;
var _totalFrames = sprite_get_number(sprite_index)/4;
image_index = (CARDINAL_DIR * _totalFrames) + min((((1 - (moveDistanceRemaining / distanceRoll)) * _totalFrames)), _totalFrames -1);

// Change State
if (moveDistanceRemaining <= 0)
{
state = PlayerStateFree;
}

if(_collided)
{
state = PlayerStateFree;
ScreenShake(4,30);
}

}

arniehgk
2021-09-08 20:32:50

function ScreenShake()
{
/// @desc ScreenShake(magnitude,frames);
/// @arg Magnitude sets the strentg of the shake (distance range)
/// @arg Frames set the length of the shake in frames (60 = 1 seconds)
with (global.iCamera)
{
if (argument0 > shakeRemain)
{
shakeMagnitude = argument0;
shakeRemain = shakeMagnitude;
shakeLength = argument1;
}
}
}

function PlayerStateRoll(){

//Movement
hSpeed = lengthdir_x(speedRoll, direction);
vSpeed = lengthdir_y(speedRoll, direction);

moveDistanceRemaining = max(0, moveDistanceRemaining - speedRoll);
var _collided = PlayerCollision();

// Update Sprite
sprite_index = spriteRoll;
var _totalFrames = sprite_get_number(sprite_index)/4;
image_index = (CARDINAL_DIR * _totalFrames) + min((((1 - (moveDistanceRemaining / distanceRoll)) * _totalFrames)), _totalFrames -1);

// Change State
if (moveDistanceRemaining <= 0)
{
state = PlayerStateFree;
}

if(_collided)
{
state = PlayerStateFree;
ScreenShake(4,30);
}

}

GeorgeMKane
2021-07-14 06:24:16

I'm going to try this with one of your tutorials. It feels like the script name is now almost a folder for a collection of similar functions, and in the scripts you set up/program the functions. Then you call them in an object with that script_execute(); bit.

Hoping I got that right.

I like the var func variation too.

Atebit Bacon
2021-07-03 05:18:25

this was an extremely frustrating update I have no idea how or why I see so many comments saying this is easier now.

my scripts only work when I write the arguments above the function in the old way and then write the code I want inside the brackets of the function.

whenever I put my arguments in the parenthesis, the script does not run correctly (or not as I would expect it to run) but it will actually show my arguments in the bottom tool tip. this was made even more confusing when I would write my arguments the old way and see them work correctly when I run the game, but in my code I would get a warning saying I have 0 arguments even though when I run the game it works as expected so I have just learned to ignore those warnings. and the gap between figuring out that my code was actually running correctly with the old arguments was not fun to figure out.

maybe Im still doing something wrong but idk because now my code is working the way I want.

Snottymcwick
2021-03-27 18:15:30

How do i do a movement script in 2021 platformer not rpg

Thy Duck
2021-03-21 03:25:56

I don't understand why the writer of the tutorial makes variables with a preceding _, it's so annoying to read.

Gumbo Factory
2021-03-20 19:08:36

H






































i

Xavier Oyola
2021-02-09 00:07:45

so basically they're just like classes in java?

Robert Hernandez
2021-02-07 22:20:42

I'm on tutorial 7 of your Platformer series... This video saved my butt! Thanks for what you do, Shaun!

didjargo
2021-01-04 16:55:41

Thanks for this easy to understand explanation. It makes sense now why they made this change. Like, if you have an RPG with 20 unique items- you used to have to write 20 individual scripts. Now you can have one script that holds 20 functions. Plus, I like how quick and easy it is to declare arguments now, especially for writing long complicated functions where you used to have to keep track of what argument represented what.

Maax Ross
2020-11-13 23:34:34

absolute beginner here, starting from Ep1 of the platformer tutorial and running into issues. I know I've got the discord and the subreddit to go to, and I probably will, but it's damn discouraging. :(======= It's not your job to supply the "total newb" with a list of potential landmines in laments terms, and I wouldn't hold you to it. It'd be nice if GMS did; and if they did, and I missed it, I'd love to read it.

Abalaster
2020-11-02 11:06:43

Coming from the second episode, I've been having this issue where my game crashes after a few seconds of running correctly (movement, animation) with just this -
"FAILED: Run Program Complete
For the details of why this build failed, please review the whole log above and also see your Compile Errors window."
There's no compile errors however. I'm unsure if this is an issue with the update, as changing the runtime doesn't seem to help. I do literally have the same PlayerAnimateSprite script as instructed in the video, just wrapped into the function{}. Consider that it works fine before crashing (which can be within a second, 10, or when going into fullscreen/moving the window) I'm unsure of where I'd go hunting the issue. Thanks in advance for any advice!

JJ Fisher
2020-10-10 14:56:02

I'm doing your Action RPG series and since updating to 2.3 I get this error: imgur.com/a/0WYSJTo imgur.com/a/0WYSJTo

Really stuck on how to fix it

EmmetsPage
2020-09-22 22:56:00

My game wont launch, it just says
"[Run] Run game
Options: Z:/Bellend_F2F4E2D7\MainOptions.json
X://windows/Runner.exe -game "Y:/Bellend_4AFCAC2_VM\bellend.win/ Bellend.win "
Attempting to set gamepadcount to 12
DirectX11: Using hardware device
Collision Event time(microsecs)=2
" and doesn't launch.
Please help.

RyderGaming
2020-09-09 09:31:33

my biggest gripe with 2.3 scripts is that I no longer can search for a function with CTRL + T but only the containing script file.

Bloodmancer
2020-09-08 04:04:44

Thank god for this video. I've been following your old tutorials for a few weeks now and absolutely could not get my scripts to function.

KaleidoDeer
2020-09-08 03:04:08

..So basically they function how they should have been from the start lmfao

Что ищут прямо сейчас
освещение в unreal engine 4 major dhyanchand hariom pawar army lovzar @sidhumoosewala волшебное преображение Zelda Missing Link ssh key Leylah Fernandez Shkurulloh domla padam albela ghar ka naam chameli wn cry javier aguirre 胡夫 new filmora x magic chess bug blessings online jobs изготовление пива в домашних условиях Noun music Hulan Banis
Похожие видео
26.07.2017
5 Useful Scripts for GameMaker Studio 2 (and 1!)

5 Useful Scripts for GameMaker Studio 2 (and 1!)

06.06.2022
Are OBJECTS becoming obsolete? - GameMaker 2022.5 Release Roundup

Are OBJECTS becoming obsolete? - GameMaker 2022.5 Release Roundup

22.06.2022
Input 5 - A free input management library for GameMaker

Input 5 - A free input management library for GameMaker

06.08.2019
What can (should) you make with GameMaker?

What can (should) you make with GameMaker?

10.05.2021
GameMaker Studio 2 - TURBO TUTORIAL - Make your first game in 12 minutes

GameMaker Studio 2 - TURBO TUTORIAL - Make your first game in 12 minutes

06.07.2022
MULTIPLAYER is easy now? - GameMaker 2022.6 Release Roundup

MULTIPLAYER is easy now? - GameMaker 2022.6 Release Roundup

26.09.2020
Array Update [GameMaker Studio 2.3]

Array Update [GameMaker Studio 2.3]

22.02.2018
Applying Settings with Scripts | Menus: GMS2 [P4]

Applying Settings with Scripts | Menus: GMS2 [P4]

06.08.2020
Beginner's Guide to GameMaker Studio 2

Beginner's Guide to GameMaker Studio 2

05.09.2020
How NOT to make an indie game

How NOT to make an indie game

12.11.2018
GameMaker Studio 2: Melee Attacks Tutorial

GameMaker Studio 2: Melee Attacks Tutorial

05.08.2021
GameMaker Studio 2 - Inventory Tutorial

GameMaker Studio 2 - Inventory Tutorial

25.07.2022
Is the new multiplayer GOOD? - Thoughts on the GameMaker Beta

Is the new multiplayer GOOD? - Thoughts on the GameMaker Beta

22.04.2022
Level Up Your GML Code | GameMaker Coaching

Level Up Your GML Code | GameMaker Coaching

15.08.2020
I Made a Fake Multiplayer .io Game

I Made a Fake Multiplayer .io Game