Author Topic: multiple hits  (Read 288458 times)

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
multiple hits
« Reply #60 on: 2005-11-22, 07:13:10 AM »
I spent most of my time this morning just modifying the project yet again to not depend on the missing media clips so I could try to run it.  Finally I got as far as realizing that commenting out the OnPlayerInit handler in the second block of code makes the project start up at least.  I guess something that it is doing is interfering with the normal operation of the game?  Maybe I'll have more time to look into it later.

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
multiple hits
« Reply #61 on: 2005-11-22, 01:46:26 PM »
heh yea, im sorry about that, i cut out hte files but it completely slipped my mind to put in small "blank" ones. i had to cut out like 20 or so files b/c a lot of them were really big, and for whatever reason, audio and video don't compress well in a zip/rar file. yea, i tried commenting out that little section, and it runs at normal speed, but the nothing scripted owrks (either forced scrolling, hit points, i didn't try the jump button, but prob doesn't..). if you noticed, there are 3 "script" files in there, the new 1 that has the attempt at both merged together, and both the other 2 split (old = forced scroll, jump, 2 player; new = hit points)
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
multiple hits
« Reply #62 on: 2005-11-23, 06:16:02 AM »
OK, simple problem (or at least simple to fix, not sure how simple the explanation is).  The block at the end of the script is incorrect.  It needs the line to connect the display events and it shouldn't have the "Play" line.  The end of the script should look like this:
Code: [Select]
HostObj.SinkObjectEvents ProjectObj.GamePlayer, "Player"
HostObj.SinkObjectEvents CurrentDisplay, "Display"
HostObj.ConnectEventsNow()

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
multiple hits
« Reply #63 on: 2005-11-23, 07:57:56 AM »
hmmm.. ok, thios fixes the slowness, and everything works except the multiple hit enemies, it doesnt crash when you hit them, but it doesn't kill them either
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
multiple hits
« Reply #64 on: 2005-11-23, 11:05:08 PM »
There's a couple things you need to fix.  Mainly you need to remove the "Sub Player_OnPlayInit()" and "End Sub" lines from the second block of code because the code inside it will never execute since gameplay has already initiated (leave it there in the first block though).  Taking the code out of the sub will force it to execute when the second script starts, which is good enough.  You will also need to remove "i" from the Dim list of that code because i is already declared as a global variable in the second script block.

This will allow the collision code to start checking things, but now you will get errors because you have multiple sprites that begin with MJS1 (you have MJS1, MJS10, MJS11, MJS12 etc).  Is there any way you could rename your sprites to names like MJS01, MJS02 ... MJS10 MJS11 etc?  Then I think we could make this whle thing work better.

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
multiple hits
« Reply #65 on: 2005-11-24, 12:18:18 AM »
All right!!! Everything works! ...except for killing MJS01-09, 10 and later work fine though. I tried doing just 1-9, and it didn
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
multiple hits
« Reply #66 on: 2005-11-24, 12:32:47 AM »
It would be easy to change, though I'm curious as to what's happening with that.  The names of the sprites should certainly be MSJ1 and not MSJ01 for the single-digit sprites....
Edward Dassmesser

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
multiple hits
« Reply #67 on: 2005-11-24, 08:20:00 AM »
Oh, I forgot, when you change the sprite names to MJS01 - MJS09, you will also have to change the script that defines their hit points because it is still expecting them to be names MJS1 - MJS9.  I got it to work by changing the block of code that sets up their hit points to this:
Code: [Select]
For i = 0 To 3
   Set Hits(i) = New Hit
   Hits(i).Hit "5-0TheMoon", "MJW" & mid(cstr(i + 101), 2), 2
Next
For i = 4 To 16
   Set Hits(i) = New Hit
   Hits(i).Hit "5-0TheMoon", "MJS" & mid(cstr(i + 97), 2), 3
Next

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
multiple hits
« Reply #68 on: 2005-11-24, 09:49:14 AM »
I only took the new Hits(i)... line for MJS because the other one stopped the MJW from working (maybe because i didn
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
multiple hits
« Reply #69 on: 2005-11-24, 10:47:28 AM »
I think you just need to add a block like this to the end of you OnAfterMoveSprites sub to reset the scrolling margins for the moon:
Code: [Select]
   If ProjectObj.GamePlayer.rMap.Name = "5-0TheMoon" Then
        oPlayer.ScrollMarginX = 292
        oPlayer.ScrollMarginY = 196
    End If

I haven't noticed any slowdown in areas like you describe.  But I can imagine why it might be happening.  When you are on an area of the map like that, you have the screen full of tiles and at some point GameDev might be drawing so many tiles that it can't finish within a single frame on slower computers.  Here are some things to try:
1. Try eliminating unnecessary tiles in background layers behind those areas (tiles covered up by foreground layers)
2. Make sure you have the latest drivers for your video card, and the latest version of DirectX.
3. Try running on a faster computer, just to get an idea of what kind of computer increases the performance to the level you want/need.
4. Try running without script.  If the game runs faster in these areas when the script is not connected we could try optimizing the script to improve performance.

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
multiple hits
« Reply #70 on: 2005-11-25, 10:14:53 AM »
Yea, I took the "mid-background" tiles off of that layer and merged then with the main layer, so I could delete that layer. It helped a little, but it
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy