Post new topic    
Page «  1, 2, 3, 4, 5, 6
Liquid Metal Slime
Send private message
 
 PostWed Jan 21, 2015 6:35 am
Send private message Reply with quote
@Urkel:
Your game sounds like a lot of fun the way you describe it. I'm really looking forward to it's completion. You should totally post some screenshots of it if you haven't already. I'm counting on some nice chunky graphics!
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Slime Knight
Send private message
 
 PostThu Jan 22, 2015 2:24 am
Send private message Reply with quote
@SheamKennedy Haha, uh oh, now I feel the pressure to come out with a fun game! I hope it turns out alright, I don't know why I've been so secretive about it... I probably ought to shoot a few screenshots up here

Now to the nonsense.
==========================================

I realize that these codes are strikingly similar to what I have already posted, but I'm just posting what I have now to help me keep things straight, and effectively inform anyone willing to help.

As it stands now, These scripts cause my game to freeze and give me a slice handle error. I believe this may be related to the order in which I have things within my while loop. When I have switched things around in my scripts I have gotten the same error, but only when I hit space. If I ignore the error, the game functions until I hit space again.



Also, my projectile is still floating right through y enemy NPCs with no effect. I am wondering if this has to do with how I am identifying my projectile (slime) If I use this in my projectile firing script
Code:
slime := load walkabout sprite (23,0)

how do I identify that in my hit detection (slimehit) script? What do I need to put in my Slice collide script?

Code:

plotscript, slimehit, begin
variable (beardo1, beardo2, beardo3, beardo4, beardo5, beardo6, beardo7, beardo8,
beardo9, beardo10, beardo11, beardo12, beardo13, beardo14, beardo15, beardo16,
beardo17, beardo18, slime)
beardo1 := get NPC slice (1)
beardo2 := get NPC slice (2)
slime := lookup slice (sli:slime)
if (slice collide (slime, beardo1) == true)
then (destroy npc (1) increment (kills, 1))
else if
(slice collide (slime, beardo2) == true)
then (destroy npc (2)increment (kills, 1))
end


Also wondering if in the above script I need to set conditionals for each enemy slice to

keep from returning nonexistent slice handles. Something like: if/while (slice is valid

(slime && beardo1) or something like that.

Code:
plotscript, mode2shoot, begin
variable (slime)
 while (kills<<10>>0)

then
(           
       slime := load walkabout sprite (23,0)
       put slice (slime, hero pixel x, hero pixel y)
            set slice velocity x (slime, 0, 30)
            set slice velocity y (slime, 15, 15) 
       (play sound (32,false,false))
 (slimehit) 
)(wait (4)) 
)
end


Also, I've added a bunch of enemy variables in my Slimehit script that are as yet, unused. I believe I a going to try to run the game without using multiple copies of the same NPCs. Many of them move at different speeds or in different patterns, so I don't think I need to worry about the MonsterTimer scripts that Gizmog posted. One the other hand, I probably have no Idea what I'm talking about! XD

Again, I know these are inane questions. And I truly wouldn't be asking if I hadn't tried a few things on my own already. It helps me to type this tuff out and get input from others as well Smile
Metal King Slime
Send private message
 
 PostThu Jan 22, 2015 6:00 am
Send private message Reply with quote
Are there any copies of NPC 1 on the map? If there aren't, Beardo1 is going to equal 0 (or -1, I forget, but either way it means there's no such guy) and

Code:

if (slice collide (slime, beardo1) == true)


Is going to be saying

Code:

Is Slime Colliding with NOBODY?


It could also be that there's no slice with the lookupcode (sli:slime), which would mean Slime is also going to equal 0 or -1. Basically, somethin somewhere doesn't exist and you're askin questions about it. You can probably fix it by making sure that Slime and Beardo1 are actually real before you ask if they're colliding with anything.
Slime Knight
Send private message
 
 PostThu Jan 22, 2015 3:40 pm
Send private message Reply with quote
Yeah, I'm thinking most likely that I'm incorrectly addressing my slime slice. I went through and created a bunch of excess NPCs in nonplayable parts of the screen to make sure that at least all the beardo's were real.

I'm attempting to add some kind of check to my hit detection script, something like this:

Code:

plotscript, slimehit, begin
variable (beardo1, beardo2, beardo3, beardo4, beardo5, beardo6, beardo7, beardo8,
beardo9, beardo10, beardo11, beardo12, beardo13, beardo14, beardo15, beardo16,
beardo17, beardo18, slime)

beardo1 := get NPC slice (1)
beardo2 := get NPC slice (2)
slime := lookup slice (sli:slime,5)

if
(slice is valid (slime) && slice is valid (beardo1))
then (
if (slice collid e (slime, beardo1) == true)
then (destroy npc (1) increment (kills, 1))
)
else if
(slice is valid (slime) && slice is valid (beardo2))
then (
if (slice collide (slime, beardo2) == true)
then (destroy npc (2) increment (kills, 1))
)
else if
(slice is valid (slime) && slice is valid (beardo3))
then (
if (slice collide (slime, beardo3) == true)
then (destroy npc (3) increment (kills, 1))
)
else (wait (1)
)

#etc...

I shall continue in my endeavor! Smile
Liquid Metal Slime
Send private message
 
 PostThu Jan 22, 2015 5:03 pm
Send private message Reply with quote
Not that my bullet-hitbox collisions are working I'd like to know if theres an easy way to destroy the bullet slice when it collides with a wall or a zone. Perhaps zone collision may be better since it will only effect the bullet, while walls already have the effect of stopping the player. Just in case I want something that the bullet can pass but the player cannot pass.

I was thinking maybe I can have a script that cycles through each "zone #1" and places an invisible "bulletStopper" slice at each of the zones that are present? Or is there a simpler way, because I'd like to avoid this if I can help it.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Metal King Slime
Send private message
 
 PostThu Jan 22, 2015 9:25 pm
Send private message Reply with quote
SimpleStealth0004.png
What it looks like when the script runs, though I didn't test anything but the basic 4 wall block.
Funny you bring that up Sheam, I'd been wonderin which one of you was gonna ask that. I think a good way might be to have a for loop that reads the passability of every maptile and creates an appropriate invisible slice. If you arranged it a certain way, with every "WallSlice" in the same container, you could then check if a shot was colliding with any of them with a FindCollidingSlice. My favorite command!

Something like:

Code:

#Global Variables, so I can check these in any script
GlobalVariable (1,MapLayer)
GlobalVariable (2,WallContainer)

plotscript,GenerateWalls,begin
#NOTE: Not sure what'll happen if this script runs on
#multiple maps. Not sure if the slices'll clear because
#they're part of a map layer or not. Worst case, you'll have
#to free the WallContainer and create a new one if you go to
#a new map

#The maptile X and Y values we're checking..
variable (CurrX)
variable (CurrY)

#The passability of CurrX,CurrY
variable (Pass)

#This is the slice that we create to represent the wall map.
variable (WallChunk)

#A handy container so we can check all our walls at once!
WallContainer := CreateContainer

#What layer of the map to hook it to: I did Obsolete Overhead
#so it'd draw on top of everything, but it could be any of
#'em.
MapLayer := Lookupslice (sl:ObsoleteOverhead)

#Connects the wall container to the map so that it uses
#the same point of reference as NPCs and the hero
SetParent (WallContainer,MapLayer)

#Starts at 0 and increases until it's reached the width of our map
for (CurrX,0,MapWidth,1)
do (
   Pass := ReadPassBlock (CurrX,CurrY)
   
   #I don't know why the ReadPassBlock stuff works like this,
   #But it's how the dictionary says to do it.
   if (Pass,and,NorthWall)
   then (
                        #Create a 20 wide, 3 high rectangle, the -1 is rectangle stuff
      WallChunk := CreateRect (20,3,-1)
   
                        #Also rectangle stuff
               SetRectBGCol (WallChunk,176)
      SetRectFGCol (WallChunk,176)

                        #Hooks it into our wall container for later find colliding fun
      SetParent (WallChunk,WallContainer)
                       
                        #And puts it on the top side of the appropriate tile
      PutSlice (WallChunk,CurrX * 20,CurrY * 20)
      )

   if (Pass,and,SouthWall)
   then (
      WallChunk := CreateRect (20,3,-1)
      SetRectBGCol (WallChunk,176)
      SetRectFGCol (WallChunk,176)
      SetParent (WallChunk,WallContainer)
                        #Puts it on the bottom side
      PutSlice (WallChunk,CurrX * 20,add (CurrY * 20,17))
      )
      
   if (Pass,and,WestWall)
   then (
                        #Creates a 3 wide twenty high rectangle
      WallChunk := CreateRect (3,20,-1)
      SetRectBGCol (WallChunk,176)
      SetRectFGCol (WallChunk,176)
      SetParent (WallChunk,WallContainer)
      PutSlice (WallChunk,CurrX * 20,CurrY * 20)
      )

   if (Pass,and,EastWall)
   then (
      WallChunk := CreateRect (3,20,-1)
      SetRectBGCol (WallChunk,176)
      SetRectFGCol (WallChunk,176)
      SetParent (WallChunk,WallContainer)
                        #Puts it on the right side
      PutSlice (WallChunk,add (CurrX * 20,17),CurrY * 20)
      )      
   
   #If this is the last column, go to the next row
   if (CurrX == MapWidth,and,NOT (CurrY == MapHeight))
   then (
      #Have to set it to -1 because the For loop oomphs
      #it up to 0
      CurrX := -1
      CurrY += 1
      )
   )

end


You could use the Vehicle A/B Passability tags to do the "Wall that shots can't go through but people can" kind of thing. After you've set all that up (and mind you you're gonna have to tweak the sizes a little to make sure a shot doesn't "skip" over those pixels and convert it to use Containers instead of Rects, I did it that way so it'd look like the maptile editor 'cause that makes me giggle) you should be able to check if any given shot is hitting the wall with a:

Code:

FindCollidingSlice (WallContainer,WhateverShotYouWantToCheck)


And while it's going through every tile on the map, it'd be pretty easy to throw in some ReadZones and set stuff up that way too.
Liquid Metal Slime
Send private message
 
 PostThu Jan 22, 2015 10:10 pm
Send private message Reply with quote
@Gizmog:
Hey I just tried your "Generate Wall" script and it worked great. I tested to see if entering a new map would automatically draw fresh wall slice and it turns out that it does.

One weird problem though (or perhaps just my first time noticing this). When I have two maps: Map 0 and Map 1, and both these maps use the same autorun script. It seems as though the autorun script does not trigger when I take a door from Map 0 to Map 1 or visa versa. I could only get this to work properly when I instead map two versions of the autorun script called: mapAutoRun and mapAutoRun1, then attached them to each map accordingly. Is this normal? Do autoruns not retrigger if the subsequent map uses the same autorun?

Now I'll move on to testing whether the walls adequately destroy the bullets...

EDIT: Wall collisions are working decently. I'll likely slow my bullet speed down anyways which will increase the level of wall collision detection.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Metal King Slime
Send private message
 
 PostFri Jan 23, 2015 12:41 am
Send private message Reply with quote
I haven't ever used auto-run scripts so I'm not sure what's goin on there.
Slime Knight
Send private message
 
 PostFri Jan 23, 2015 1:26 am
Send private message Reply with quote
I haven't made much progress in mode B of the game I'm doing, but Mode A is just about ready for playing, I think. I've included a page from the *ahem* "manual" that would have accompanied this game in its retail package. This is my compromise for posting screenshots. Inb4- Desperate is spelled wrong (might leave it that way XD)

If you are unfamiliar, this game is based (very loosely) off of David Cronenberg's 1986 film The Fly starring Jeff Goldblum and Geena Davis.
Metal King Slime
Send private message
 
 PostFri Jan 23, 2015 2:09 am
Send private message Reply with quote
Urkelbot666 wrote:
I haven't made much progress in mode B of the game I'm doing, but Mode A is just about ready for playing, I think. I've included a page from the *ahem* "manual" that would have accompanied this game in its retail package. This is my compromise for posting screenshots. Inb4- Desperate is spelled wrong (might leave it that way XD)

If you are unfamiliar, this game is based (very loosely) off of David Cronenberg's 1986 film The Fly starring Jeff Goldblum and Geena Davis.


I love you.
Liquid Metal Slime
Send private message
 
 PostFri Jan 23, 2015 3:50 am
Send private message Reply with quote
@Gizmog: No worries. I was just curious. Since I got it working anyways it's not a big deal.

@Urkel: Awesome! The graphics are very satisfying. The Fly is a great source of film inspiration too.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Display posts from previous:
Page «  1, 2, 3, 4, 5, 6