Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: [Help] A function isn't working (Views)  (Read 1578 times)

0 Members and 1 Guest are viewing this topic.
[Help] A function isn't working (Views)
« on: July 15, 2007, 06:02:30 am »
  • Personal Text
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1229
So I am making kind of a game where there is multiple players(don't worry anyone, I am still working on FK) and when they win a minigame, the other 3 views go away, and it only shows the player that wins, view, but
Code: [Select]
view_visible[1]=0isn't working.  It's simply not making the view go away at all on the other views

Here's an example of the code:
Code: [Select]
if global.player1won=true{
with global.player2character{instance_destroy()}
with global.player3character{instance_destroy()}
with global.player4character{instance_destroy()}
view_visible[1]=0; view visible[2]=0; view_visible[3]=0}

View0 is Player1
View1 is Player2
etc.

global.Player#character is already initiated by another object.
So you see, I try to make the other views go away, so in their place a black screen appears, but simply, nothing happens.
So what am I doing wrong?

Thanks a bundle, and I might credit anyone who helps :)
Mewgull

Logged
Re: [Help] A function isn't working (Views)
« Reply #1 on: July 15, 2007, 11:10:54 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 53
I'm not too familiar with the language that you're using, but is view_visible a global variable/array?

You said in you're title that "a function isn't working" so if the code that you supplied is within a function and view_visible is NOT a global, then setting view_visible = ... inside the function will have no effect on view_variable outside the function.

If I'm right, simply setting view_visible as a global should solve the problem.
Logged
Re: [Help] A function isn't working (Views)
« Reply #2 on: July 15, 2007, 11:29:25 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 2245
could you show a screenshot of what's happening?
both for when they're visible and when you try to hide them.
Logged
Re: [Help] A function isn't working (Views)
« Reply #3 on: July 21, 2007, 12:11:21 pm »
  • Personal Text
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1229
There no point, nothing is happening.
All the views are visible when its not trying to hide them, and all the views are still visible when it DOES try to hide them... :\
Logged
Re: [Help] A function isn't working (Views)
« Reply #4 on: July 21, 2007, 12:21:54 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 53
Have you tried my suggestion yet? Also, letting us know the results of steps you've taken that DON'T solve the problem may be able to guide us to the true cause. Any additional information you can provide would also help.
Logged
Re: [Help] A function isn't working (Views)
« Reply #5 on: July 21, 2007, 03:14:12 pm »
  • Personal Text
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1229
View visible is a global function.
so I tried this:

global.visibleview=view_visible.
and that didn't work

Then I tried changing every view_visble to global.view_visible, but still nothing works

And I have a question:  Would putting "false" instead of putting "0" do anything?
Logged
Re: [Help] A function isn't working (Views)
« Reply #6 on: July 21, 2007, 03:28:14 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6206

And I have a question:  Would putting "false" instead of putting "0" do anything?
No, 0 is false.
Logged
Re: [Help] A function isn't working (Views)
« Reply #7 on: July 21, 2007, 09:44:15 pm »
  • Personal Text
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1229
alright, just making sure ;)

So anyone, have a solution?
Logged
Re: [Help] A function isn't working (Views)
« Reply #8 on: July 25, 2007, 01:52:58 pm »
  • Personal Text
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1229
Bump.
I need this :\
Logged
Re: [Help] A function isn't working (Views)
« Reply #9 on: July 25, 2007, 02:09:15 pm »
  • =/
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 2284
 Well, not sure if you tried this but instead of getting rid of the views entirely, you could always try to shrink them to a miniscule scale. I don't remember much but I think:

Code: [Select]
view_xscale[1] = 0
view_yscale[1] = 0
Should do it.
Logged
Re: [Help] A function isn't working (Views)
« Reply #10 on: July 25, 2007, 02:31:40 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 2245
There no point, nothing is happening.
All the views are visible when its not trying to hide them, and all the views are still visible when it DOES try to hide them... :\
I'm confused :S

global.Player#character is already initiated by another object.
So you see, I try to make the other views go away, so in their place a black screen appears, but simply, nothing happens.
So what am I doing wrong?
so are there black screens appearing in their place or aren't there?
Logged
Re: [Help] A function isn't working (Views)
« Reply #11 on: July 25, 2007, 02:41:58 pm »
  • Fear my Blades
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 562
You could always try drawing a black screen in the other views manually.

Something like this code in an object drawn after everything else would work:
Code: [Select]
if view_current!=player that wons view
{
  draw_clear(c_black)
}

Actually I think what might be happening is that the views actually are disabled, but their area in the window isn't being refreshed so it might look as though they're still there.  Can they be changed any after you've 'disabled' them?
Logged

I've done it (sorta)!  Bloom Lighting in GameMaker, and 3D mode too!  Check out the awesome Screen Saver.
  • Kousou Games
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.303 seconds with 58 queries.