• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Mac OSX Destroy! I MUST DESTROY!

WWAZman

Member
after upconverting my GMS1.4 game to GMS2, everything is in code.. most of it is ok, but I can't figure out this part.. What I need to do is, somewhere where my character is noted that dead is true, tell it to then destroy an instance of the arrows_controller (so that it doesn't keep recreating it, which is on the create step of my character - every time he dies I realized another set is recreated, lessening the transparency)

So where can I put in the instance destroy?

Code:
action_set_relative(1);
var __b__;
__b__ = action_if(dead);

if __b__

{
action_set_relative(0);
exit;
}

__b__ = action_if_empty(0, 1, 0);
if __b__
{
    {

        action_set_relative(0);
        action_set_gravity(270, 0.4);
        action_set_relative(1);
    }
}
else
{
    {
        action_set_relative(0);
        action_set_gravity(270, 0);
        action_set_relative(1);
    }
}

__b__ = action_if_variable(vspeed, 12, 2);
if __b__
{
    {
        action_set_relative(0);
        vspeed = 12;
        action_set_relative(1);
    }
}
if keyboard_check(vk_up) and jumpcontrol = true
{
 vspeed -= 4.2
}


action_set_relative(0);
 

EvanSki

King of Raccoons
I'd cut your losses and rewrite all of that, what ever that is,

if im reading it right put it inside the {} here

Code:
__b__ = action_if(dead);
 if __b__ { action_set_relative(0); exit; }
 

ParodyKnaveBob

The Laughing Rogue
That action_set_relative() function is really throwing me without context. (Of course, I'm an ignoramus without GMS2, but still.) Perhaps it'd also help (others at the very least) if you also included a screenshot of your GM:S 1.4 project's DnD list? Perhaps even better, hit the "Object Information" button on the appropriate object and copy/paste that info here? Maybe both? $:^ }
 

WWAZman

Member
That action_set_relative() function is really throwing me without context. (Of course, I'm an ignoramus without GMS2, but still.) Perhaps it'd also help (others at the very least) if you also included a screenshot of your GM:S 1.4 project's DnD list? Perhaps even better, hit the "Object Information" button on the appropriate object and copy/paste that info here? Maybe both? $:^ }
that *IS* the DND.. after being converted and it says it's a oneway conversion =( Everything *WAS* DND with the exception of some code snippets here and there. always commented by me so I know what does what does what and where and why. (!!!) (and actually I cleaned it up for posting here by indenting it)

I am NOT a coder, so I'm a bit lost at best.. I know it all works, has for years,.. but now I have to modify it #nightmare.

I'm trying to tell it to delete "arrows_controller" but I don't understand what the syntax in code is supposed to be.. if I drag a DND into it the best would be AFTER all those commands, not inbetween it.. Help understanding the syntax is GREATLY appreciated!
 

ParodyKnaveBob

The Laughing Rogue
I repeat,
Perhaps it'd also help (others at the very least) if you also included a screenshot of your GM:S 1.4 project's DnD list? Perhaps even better, hit the "Object Information" button on the appropriate object and copy/paste that info here? Maybe both? $:^ }
Emphasis:
If you give the information from the 1.4 IDE, it'll give context to what you've given from the 2.x IDE.

EDIT: Good point here:
If I had GMS2 access, I could easily see what the compatibility script (which I more or less forgot existed) would be for action_set_relative(). Looks like I'll just mosey on along and let GMS2 users help fix this probably super simple problem.
 
Last edited:

ParodyKnaveBob

The Laughing Rogue
A screenshot from GMS2 probably isn't helpful since it's just the code you pasted anyway. Fwiw, if you meant to follow my suggestion, it would look more like this:

upload_2019-9-10_0-22-36.png

Information about object: obj_clown
Sprite: spr_clown
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
start moving in directions 111101111 with speed set to 4
scale the sprite with 1 in the xdir, 1 in the ydir, rotate over direction, and no mirroring
set Alarm 0 to 60
Alarm Event for alarm 0:
start moving in directions 111101111 with speed set relative to 0
scale the sprite with 1 in the xdir, 1 in the ydir, rotate over direction, and no mirroring
set Alarm 0 to 60
Collision Event with object obj_wall:
bounce not precisely against solid objects
scale the sprite with 1 in the xdir, 1 in the ydir, rotate over direction, and no mirroring
play sound snd_bounce; looping: false
Mouse Event for Left Pressed:
set the score relative to 10
play sound snd_click; looping: false
jump to a random position with hor snap 0 and vert snap 0
start moving in directions 111101111 with speed set relative to 0.5
 

WWAZman

Member
I don't have gms 1.4 on my computer anymore, I can't paste that. converting to "DND" produces the exact same code window.
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
If you're yet to start changing the project and have a 1.4 version on hand still, a while ago I made a tool that converts all of your DnD into clean code (and then you can import that code-only project into GMS2)
 

Yal

🐧 *penguin noises*
GMC Elder
Why can't you just put the code to destroy the arrow controller in the character's destroy event? Then you know it's run whenever the character is destroyed. (Just don't make the character accidentally destroy themselves in their destroy event, or it creates an infinite loop that crashes the game)
 

WWAZman

Member
Why can't you just put the code to destroy the arrow controller in the character's destroy event? Then you know it's run whenever the character is destroyed. (Just don't make the character accidentally destroy themselves in their destroy event, or it creates an infinite loop that crashes the game)
ahh.. you just hit the nail on a head or two..
String not found "Event_Other_NoMoreLives"
String not found ""Event_Other_NomoreHealth"

so THAT'S why the lives counter doesn't work..

DARN you and your LOGIC!! :p hehe
 
Last edited:
Top