C
Caniss Altari
Guest
I'm taking HeartBeast's Turn-Based RPG course and I've been having a bit of trouble with converting it to GMS2 in regards to the new view system. Here are the compile errors I got:
Script: view_approach at line 14: unexpected symbol "=" in expression
Script: view_approach at line 14: malformed assignment Here's my code:
///view_approach(x, y, width, height, speed, zoom_speed)
var xx = argument0;
var yy = argument1;
var width = argument2
var height = argument3
var spd = argument4
var zoom_spd = argument5
//Move towards the target
x = lerp(x, xx, spd);
y = lerp(y, yy, spd);
//Scale the view
camera_get_view_width(view_camera[0]) = lerp(camera_get_view_width(view_camera[0]), width, zoom_spd);
camera_get_view_height(view_camera[0]) = lerp(camera_get_view_height(view_camera[0]), height, zoom_spd);
And the code that the course was using is:
///view_approach(x, y, width, height, speed, zoom_speed)
var xx = argument0;
var yy = argument1;
var width = argument2
var height = argument3
var spd = argument4
var zoom_spd = argument5
//Move towards the target
x = lerp(x, xx, spd);
y = lerp(y, yy, spd);
//Scale the view
view_wview[0] = lerp(view_wview[0], width, zoom_spd);
view_hview[0] = lerp(view_hview[0], height, zoom_spd);
Script: view_approach at line 14: unexpected symbol "=" in expression
Script: view_approach at line 14: malformed assignment Here's my code:
///view_approach(x, y, width, height, speed, zoom_speed)
var xx = argument0;
var yy = argument1;
var width = argument2
var height = argument3
var spd = argument4
var zoom_spd = argument5
//Move towards the target
x = lerp(x, xx, spd);
y = lerp(y, yy, spd);
//Scale the view
camera_get_view_width(view_camera[0]) = lerp(camera_get_view_width(view_camera[0]), width, zoom_spd);
camera_get_view_height(view_camera[0]) = lerp(camera_get_view_height(view_camera[0]), height, zoom_spd);
And the code that the course was using is:
///view_approach(x, y, width, height, speed, zoom_speed)
var xx = argument0;
var yy = argument1;
var width = argument2
var height = argument3
var spd = argument4
var zoom_spd = argument5
//Move towards the target
x = lerp(x, xx, spd);
y = lerp(y, yy, spd);
//Scale the view
view_wview[0] = lerp(view_wview[0], width, zoom_spd);
view_hview[0] = lerp(view_hview[0], height, zoom_spd);