Author Topic: Portal Recreation help? :)  (Read 2174 times)

Rad

  • Wannabe
  • Posts: 10
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 43.0.2357.130 Chrome 43.0.2357.130
    • View Profile
  • Playstyle: Keyboard
Portal Recreation help? :)
« on: June 25, 2015, 08:53:27 AM »
Hi, beginner fangame maker here.

I'm trying to recreate this:

As someone with little gamemaker experience, I have no idea how to go about doing this. Could someone help me?

Please be explicit if you can in your explanation because I will have trouble following. This is from I Wanna be the Calamity Fortune and I'm using Gamemaker: Studio.
Those two colors are actually perfect, although a white color would be cool too. Thanks so much!

pieceofcheese87

  • Global Moderator
  • The Kid
  • Posts: 346
  • Personal Text
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Chrome 43.0.2357.130 Chrome 43.0.2357.130
    • View Profile
    • Twitch Tv Channel
  • Playstyle: Keyboard
Re: Portal Recreation help? :)
« Reply #1 on: June 25, 2015, 01:39:30 PM »
This was created using game maker's particle system. If you want the exact code for this, make an object for the effect and put in this code:
https://pastebin.com/vgz5BpHE

Signature

Rad

  • Wannabe
  • Posts: 10
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 43.0.2357.130 Chrome 43.0.2357.130
    • View Profile
  • Playstyle: Keyboard
Re: Portal Recreation help? :)
« Reply #2 on: June 25, 2015, 06:05:03 PM »
First of all you're a beast Pieceofcheese :P

Second, I'm having a bit of trouble. It's kinda hard to explain so I highlighted my short explanation of it.
https://www.twitch.tv/r4d1at10n/c/6881856
Also, the portal is white because I was messing around with the RGB trying to see what different colors I could get.

Also, did you just decompile Calamity Fortune to look at the code? If so, I'd love to know how to do that. I'm sure that if you aren't able to answer my question about getting the warp to work, you can just look in the Calamity Fortune files. But the thing is that I would never have had to make this thread had I been able to do that myself. Thanks for the help so far, as an amateur at best I really appreciate it :)


Rad

  • Wannabe
  • Posts: 10
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 43.0.2357.130 Chrome 43.0.2357.130
    • View Profile
  • Playstyle: Keyboard
Re: Portal Recreation help? :)
« Reply #3 on: June 25, 2015, 08:07:32 PM »
Also when I put the portal object back as normal without the effect, I get this crash upon entering the portal


Derf

  • Guest
Re: Portal Recreation help? :)
« Reply #4 on: June 25, 2015, 08:54:02 PM »
Hey Rad,

Cheese may have just written it himself seeing as it's not a massively complex code - though if it is 1:1 to the game you mention then he may have decompiled. Decompiling is frowned upon by some people last time I checked, though that was about 3 years ago, and the forum I was at previous had a rule where you weren't allowed to post a link to it (I'm not sure how enforced it was, most people just PM'd it). I don't want to risk it if it is also the case here, but you can just google "Gamemaker Decompiler" to find a link to the program; though I'm unsure if they make a Studio version, which is fine since most fangames are made in GM8/GM8.1.

In terms of your problem, if there's no sprite you can't do collisions as there's nothing for the player to collide with, regardless of if the object is producing particles. The reason the portal is spawning at the top left of the 32x32 block and not the middle is because before you had a sprite which was centered in the middle of the block and that's where the particles would spawn from but since removing it you don't. In other words, you need the sprite, you just don't need to draw the sprite. I'm not on a computer with game maker currently so off the top of my head I would suggest putting the sprite back into the object but setting it invisible by unchecking the visible box in the object; failing that adding a draw event and just putting in some empty brackets like this "{}" may work. While these will fix your collision problem and also not draw the sprite I am unsure as to whether they will nullify the particles, but I doubt it.

If that doesn't work and they do stop the particles then add this to the step event "if(collision_rectangle(x,y,x+32,y+32,player,0,0) { XXXXXXXXXXXXX }" and then where I've put the X's add the code you want for collision (in this case room changing). Also, why it appears in front of your player is to do with this line of code "part_system_depth(Sname,-1);", if the player object's depth is -1 or lower then the particles may/will spawn in front of it. Try setting it to 0 or 1.

Hope this helped, I find GML terribly hard to explain so if you need me to elaborate on anything don't hesitate to ask :~)

Rad

  • Wannabe
  • Posts: 10
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 43.0.2357.130 Chrome 43.0.2357.130
    • View Profile
  • Playstyle: Keyboard
Re: Portal Recreation help? :)
« Reply #5 on: June 25, 2015, 09:25:52 PM »
WOW! Thanks Derf! That fixed the issue. Didn't know I could just uncheck the visible box :P
Thanks for the help!

However the crash is occurring still, and yet to find a cause for that. I'm sure it must have something to do with me messing around trying to get the portal to be invisible but can't figure out what. Any help is appreciated! :D

Derf

  • Guest
Re: Portal Recreation help? :)
« Reply #6 on: June 25, 2015, 09:35:08 PM »
No worries man, it's all stuff you pick up along the way :~)

Not too good at reading GM:S errors myself, is the "onCollide" variable definitely initialised in your warp object (in the create even etc)?