Jump to content


Photo

My portal project


  • Please log in to reply
15 replies to this topic

#1 cantavanda

cantavanda

    GMC Member

  • Banned Users
  • 980 posts
  • Version:GM:Studio

Posted 05 June 2012 - 12:20 PM

Hello,

Lately, i've been working on a 3D FPS portal game.
It is my first 3D project ever.
But it is hard and I need some help...

Well, first, here 2 screenshots of the game:
Posted Image


Posted Image

PORTALGUNBLUE CODE
I already have the code when you click:
if can_shoot = 1 and image_speed = 0
{
  can_shoot = 0
  image_speed = 1
  sound_play (snd_pgunblue)

  player.zdirection += 0.02


}
Then there is a animation that the gun gets a bit of recoil.
The actions after animation:
set image_speed to 0
set can_shoot to 0
change object in PortalGunOrange

There are other codes, but i'm not telling them.
The object PortalGunOrange has the same codes.



But my problem now.
I have no idea how i'm gonna create portals, and the orbs that create portals.
That are missing in the codes when you click.

So the parent of all solid objects is the object: object_basic.
So when the portal shoots an orb and the orb hits any object_basic object he changes in to a portal.

So I need the codes for 4 objects:
Orange orb
Blue orb
Orange portal
Blue portal

I want the effect of the code exactly like in portal (fast thing comes in, fast thing comes out)
If you need other codes from other objects to create a portal then tell me.

Please help.

#2 Misu

Misu

    Awesometasticness!

  • GMC Member
  • 435 posts
  • Version:GM:Studio

Posted 05 June 2012 - 12:50 PM

When bullet hits wall or something, the bullet instance will be destroyed and it creates a new object afterwards. There is an example that might help you create the effects.
Its in this following topic but you'll have ti find it in the list.

http://gmc.yoyogames...howtopic=180812
  • 0

#3 cantavanda

cantavanda

    GMC Member

  • Banned Users
  • 980 posts
  • Version:GM:Studio

Posted 05 June 2012 - 12:56 PM

Um I don't need effects but I need codes for orbs and portals

#4 Misu

Misu

    Awesometasticness!

  • GMC Member
  • 435 posts
  • Version:GM:Studio

Posted 05 June 2012 - 12:59 PM

well you do know this forum page is for advance users (only to discuss codes and not offer) but offering are ok here. now you want something for the portal. there is an example similar to what you want but you have to program it.
http://www.host-a.ne...fps6monitor.gm6

EDIT OOPS! Wrong link. Here you go!

Edited by MisuMen49, 05 June 2012 - 01:00 PM.

  • 0

#5 cantavanda

cantavanda

    GMC Member

  • Banned Users
  • 980 posts
  • Version:GM:Studio

Posted 05 June 2012 - 01:00 PM

Okay i'll check that out and hopely it helps me

Sorry it doesn't help me misumen

I'm just gonna wait until a coding expert answers this thread

Moderator edit: Triple post unified. DO NOT DO THIS AGAIN.

#6 Misu

Misu

    Awesometasticness!

  • GMC Member
  • 435 posts
  • Version:GM:Studio

Posted 05 June 2012 - 01:14 PM

Dude, you don't ask for code; you learn them. So that way you can create a game without copy/pasting them all the time. Plus, you can't double post because it bothers members and could get you a warning. :ermm:

Listen, I am an expert but I just don't like seeing members like you asking for codes just to copy/paste them into the game. You have to learn.
  • 0

#7 cantavanda

cantavanda

    GMC Member

  • Banned Users
  • 980 posts
  • Version:GM:Studio

Posted 05 June 2012 - 01:18 PM

Yes, if you tell me, you can explain how that code worked.
And I can learn from it.

Copy/pasting ruins the fun of coding.
I want to learn from it, really :thumbsup:

EDIT: and by the way I fixed that 'you can see through walls' error

Edited by cantavanda, 05 June 2012 - 01:19 PM.


#8 Misu

Misu

    Awesometasticness!

  • GMC Member
  • 435 posts
  • Version:GM:Studio

Posted 05 June 2012 - 01:23 PM

Well in that case, good for you. But if thats so, then this topic should be moved to Novice & Intermediate because this is more like a request for Intermediate programmers. And it says it here on the description:

In this forum people can ask questions regarding the creation of 3D games with the 3D features in GM6, 7, and 8. This forum is for advanced users only. If you are new to 3D, try the Novice and Intermediate Users forum first.


If you like help, then wait for a moment to see if anyone moves this topic or help, but please don't double post because its the rules here. ;)
  • 0

#9 MaxRock

MaxRock

    GMC Member

  • GMC Member
  • 36 posts
  • Version:GM8

Posted 05 June 2012 - 01:45 PM

3d surfaces are your friend~ I think this gonna help you, as it provide a portals example in the package: LINK
  • 0

#10 Misu

Misu

    Awesometasticness!

  • GMC Member
  • 435 posts
  • Version:GM:Studio

Posted 05 June 2012 - 02:24 PM

i didn't knew about this. that looks great. :thumbsup:
  • 0

#11 cantavanda

cantavanda

    GMC Member

  • Banned Users
  • 980 posts
  • Version:GM:Studio

Posted 05 June 2012 - 02:28 PM

Damn I have GM8 not GM8.1

#12 MaxRock

MaxRock

    GMC Member

  • GMC Member
  • 36 posts
  • Version:GM8

Posted 05 June 2012 - 02:53 PM

Damn I have GM8 not GM8.1


Check this then: Link
  • 0

#13 cantavanda

cantavanda

    GMC Member

  • Banned Users
  • 980 posts
  • Version:GM:Studio

Posted 05 June 2012 - 03:47 PM

The function
dot_product_3d
doesn't work in GM8 :(
So the portal example won't work :(

#14 MaxRock

MaxRock

    GMC Member

  • GMC Member
  • 36 posts
  • Version:GM8

Posted 05 June 2012 - 04:39 PM

The function

dot_product_3d
doesn't work in GM8 :(
So the portal example won't work :(


Substitute that function then. Create a script, and put into it this:

return argument0 * argument3 + argument1 * argument4 + argument2 * argument5

Then, change the dot_product_3d with your script's name in the obj_player.
  • 0

#15 Gamer3D

Gamer3D

    Human* me = this;

  • GMC Member
  • 1590 posts
  • Version:GM8.1

Posted 05 June 2012 - 06:50 PM

Substitute that function then. Create a script, and put into it this:

return argument0 * argument3 + argument1 * argument4 + argument2 * argument5


dot_product_3d is a little more complicated than that (Yes, yes. I know it differs from the mathematical definition). Let me fix it for you:

var mag_squared;
mag_squared = (argument0 * argument0 + argument1 * argument1 + argument2 * argument2) * (argument3 * argument3 + argument4 * argument4 + argument5 * argument5);
if (mag_squared == 0)
  return 0;
return (argument0 * argument3 + argument1 * argument4 + argument2 * argument5) / sqrt(mag_squared);

Then, change the dot_product_3d with your script's name in the obj_player.

Or just name the script "dot_product_3d"... :biggrin:

The function

dot_product_3d
doesn't work in GM8 :(
So the portal example won't work :(

See? This is why one reason why we tend to prefer that people do something other than copy-and-paste. It's not so much that we care that someone uses our code (We released the source after all) but that when someone inevitably messes something up while using something they don't understand, they ask us. To us, the solution is often painfully obvious and simple, but explaining it to someone who doesn't even understand the simple solution is annoying at best.

To put it another way, this is like a literature major copying a mathematics major's formula EXACTLY, despite the problem being a bit different. When problems arise, they will pester the math major to fix it. Point is, they are in over their heads and hurting the people who tried to help.

EDIT: Well that's embarrassing. Copy-pasted my own code and forgot to change some variables. :dry: Fixed now.
EDIT #2: Added some credentials for the function code.

Edited by Gamer3D, 05 June 2012 - 06:55 PM.

  • 0

#16 BattleRifle BR55

BattleRifle BR55

    Moo

  • GMC Member
  • 8249 posts
  • Version:GM7

Posted 10 June 2012 - 01:52 PM

Sounds like you pretty much want a major aspect of the basic engine it would take to power this game. That is asking for way to much, crossing the line of having others making the game for you. I mean, even though you want to learn from what would be given to you, you're still going to be copying and pasting. Reading it over when you do doesn't make it any better than not doing so, as the end result is still the same - someone else's work in your game. You will only learn what it takes to create such a thing, but not exactly how to do so. Take a few steps back and break up all the things you want, looking into each part individually. This focus will help you get a better grasp on how to go about creating what you need. Every great journey starts with one step, and there is no exception to that here.
  • 2




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users