Here's a short screen capture video of my game...

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

User avatar
sheamkennedy
Liquid Metal Slime
Posts: 1110
Joined: Mon Sep 16, 2013 9:29 pm
Location: Tama-shi, Tokyo, Japan
Contact:

Post by sheamkennedy »

Alright. I'm assuming comparing the XY positions of the hero and NPC would result in the NPC having a radial line of sight that encompasses the rear of that NPC as well. I was more or less considering this option for a game similar to Metal Gear Solid in which the enemy NPC has a cone-like line of sight that always points forwards thus allowing the player to go unseen to the rear. Or is there just a way of doing this with XY comparisons?
⊕ 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
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Yeah, you can still do a line cone of sight pretty easily with X Y comparisons.

One of the reasons it would be easier than writing zone tiles, is that just to know which zone tiles you needed to write would require almost exactly the same X Y comparisons as the method that does not use zones.
User avatar
Pepsi Ranger
Liquid Metal Slime
Posts: 1419
Joined: Thu Nov 22, 2007 6:25 am
Location: South Florida

Post by Pepsi Ranger »

Fortunately, TMC said that he hasn't finished the zones feature and still has a few more things to add, including script triggers upon entering and exiting zones. Maybe he can figure out a way to code moveable zones that can attach to an NPC or a slice (or a hero).

Oh, and I have two Hamsterspeak articles regarding all of the current uses for zones:

"Zoned In Pt. 1"

http://superwalrusland.com/ohr/issue49/index.html

"Zoned In Pt. 2

http://superwalrusland.com/ohr/issue54/index.html

Perhaps they will give you more ideas for use.
Place Obligatory Signature Here
User avatar
sheamkennedy
Liquid Metal Slime
Posts: 1110
Joined: Mon Sep 16, 2013 9:29 pm
Location: Tama-shi, Tokyo, Japan
Contact:

Post by sheamkennedy »

Thanks a lot both of you. I'll read up on the articles.
⊕ 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
User avatar
sheamkennedy
Liquid Metal Slime
Posts: 1110
Joined: Mon Sep 16, 2013 9:29 pm
Location: Tama-shi, Tokyo, Japan
Contact:

Post by sheamkennedy »

Now that I'm attempting to switch my climbing scripts over to using zones I', running in to some scripting errors. This is being run as an Each-step Script. What I want it to do is check if my leader hero is in zone 1, if so change heros to their climbing sprites, check if in zone 2, if so change to horizontal pipe climbing sprite, check if in zone 3, if so change to vertical pipe climbing sprite, otherwise just revert to default sprites.

I originally attempted Pepsi Rangers script but ran in to trouble with:

Code: Select all

If (read zone (0, x, y)) then( 
reset hero picture (find hero(0), outside battle) 
   reset hero picture (find hero(1), outside battle) 
   reset hero picture (find hero(3), outside battle) 
I'm assuming this didn't work because zone 0 is not a valid input...


Instead I decided to try my own way... so far I have:

Code: Select all

plotscript, Climbing and SFX, begin 

variable (x, y) 

x := hero x (0) 

y := hero y (0)

  
If (read zone (1, x, y)) then(
	set hero picture (find hero(0), 6, outside battle) 
   	set hero picture (find hero(1), 8, outside battle) 
   	set hero picture (find hero(3), 9, outside battle) 
#change sprite numbers to appropriate climbing sprites 
#play sound (sfx:ladder, false) 
) 

else if (read zone (2, x, y)) then( 
	set hero picture (find hero(0), 12, outside battle) 
   	set hero picture (find hero(1), 8, outside battle) 
   	set hero picture (find hero(3), 9, outside battle) 
#change sprite numbers to appropriate horizontal pipe sprites 
#play sound (sfx:pipes, false) 
)
 
else if (read zone (3, x, y)) then(
	set hero picture (find hero(0), 12, outside battle) 
   	set hero picture (find hero(1), 8, outside battle) 
   	set hero picture (find hero(3), 9, outside battle) 
#change sprite numbers to appropriate vertical pipe sprites 
#play sound (sfx:pipes, false)  
)

else (
	reset hero picture (find hero(0), outside battle) 
   	reset hero picture (find hero(1), outside battle) 
   	reset hero picture (find hero(3), outside battle) 
#change sprite numbers to default
) 

end
I seem to be getting the following compiler error though:


Code: Select all

Semicompiling Game Code.HSS to Game Code.hs
reading Game Code.HSS
including /Applications/OHRRPGCE-Custom.app/Contents/MacOS/support/plotscr.hsd
including 
/Applications/OHRRPGCE-Custom.app/Contents/MacOS/support/scancode.hsi
1957 lines read from 3 files
preliminary pass
parsing top-level
compiling scripts.........................................................................................................................................
ERROR: in script climbingandsfx on line 38 in Game Code.HSS
else if (read zone (2, x, y)) then( 
^
Unrecognised name elseif. It has not been defined as script, constant, 
variable, or anything else
After referring to the Dictionary of Plot Scripting I cannot seem to see anything wrong with my syntax albeit I'm very tired at the moment. If anyone can point me in the right direction please do.

Also I foresee some problems with the current structure of this script. I'm afraid that later on in my games development when I run other scripts that change the hero sprites for certain animation and such, that this current script will revert my heros sprites back to default even though I want something different to happen. Is there a way around this.
⊕ 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
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

What version of the OHRRPGCE are you using?
User avatar
sheamkennedy
Liquid Metal Slime
Posts: 1110
Joined: Mon Sep 16, 2013 9:29 pm
Location: Tama-shi, Tokyo, Japan
Contact:

Post by sheamkennedy »

Bob the Hamster wrote:What version of the OHRRPGCE are you using?
I'm assuming the version is read from the bottom lines of my OHRRPGCE Editor. From what I can tell I'm using:

OHRRPGCE Editor Version alectormancy+2 20120731 gfx_sdl music_sdl

Will updating fix the problem I'm having?
⊕ 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
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Ah yes, that is the issue. The "else if" command had not yet been added in alectormancy+2

You should update to beelzebufo http://rpg.hamsterrepublic.com/ohrrpgce/Downloads
User avatar
sheamkennedy
Liquid Metal Slime
Posts: 1110
Joined: Mon Sep 16, 2013 9:29 pm
Location: Tama-shi, Tokyo, Japan
Contact:

Post by sheamkennedy »

Excellent. Thanks again.
⊕ 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
User avatar
Pepsi Ranger
Liquid Metal Slime
Posts: 1419
Joined: Thu Nov 22, 2007 6:25 am
Location: South Florida

Post by Pepsi Ranger »

Yeah, "else" should've been my go-to on that script. Sorry about that.

The problem with scripts interfering with your animation is an easy fix. I have global variables attached to mine to regulate what should happen and where. So, for example, if you're climbing a vertical pipe, and you need the script to take over and animate "falling," you just set a conditional--we'll call it "climbingstate"--and the script will respond accordingly:

Code: Select all

if (climbingstate==0) then(
if (read zone (3,x,y)) then(
#change to climbing sprites
)
)
if (climbingstate==1) then(
#change to falling sprite
)
end
Pretty simple, really.

You'll also want to use "if (current map==map)" type conditionals to ensure that you don't have your heroes climbing on grass should they enter Zone 3 on another map. That way you can use the same script for all maps.
Place Obligatory Signature Here
User avatar
sheamkennedy
Liquid Metal Slime
Posts: 1110
Joined: Mon Sep 16, 2013 9:29 pm
Location: Tama-shi, Tokyo, Japan
Contact:

Post by sheamkennedy »

Thanks, this will be useful later on. I actually did follow your first method. To compensate for the dismounting of my heros I just reserved zone 1 to be the dismount zone, then I drew in zone 1 at each exit of the ladder. I also utilized the find hero function so I could make each hero mount and dismount the ladder independently of their caterpillar party position.

Here's how the script looks:

Code: Select all

plotscript, Climbing and SFX, begin 

variable (x, y, a, b, c, d ) 

x := hero x (find hero (0)) 

y := hero y (find hero (0)) 

a := hero x (find hero (1)) 

b := hero y (find hero (1)) 

c := hero x (find hero (3)) 

d := hero y (find hero (3)) 


#Zone 1 - Changes sprite numbers to default
If (read zone (1, x, y)) then(
	set hero picture (find hero(0), 2, outside battle) 
) 

If (read zone (1, a, b)) then(
	set hero picture (find hero(1), 4, outside battle) 
)

If (read zone (1, c, d)) then(
	set hero picture (find hero(3), 3, outside battle) 
)


#Zone 2 - Changes sprites to ladder  
If (read zone (2, x, y)) then(
	set hero picture (find hero(0), 6, outside battle)  
#play sound (sfx:ladder, false) 
) 

If (read zone (2, a, b)) then(
	set hero picture (find hero(1), 8, outside battle) 
)

If (read zone (2, c, d)) then(
	set hero picture (find hero(3), 9, outside battle) 
)
end
I think this script may be best since it's not constantly switching my heros to default. As long as my dismount zone is always 1 and my ladder mount zone is always 2 on each map there shouldn't be a problem.

I'll probably upload another video soon to show off the improvement.
⊕ 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
User avatar
sheamkennedy
Liquid Metal Slime
Posts: 1110
Joined: Mon Sep 16, 2013 9:29 pm
Location: Tama-shi, Tokyo, Japan
Contact:

Post by sheamkennedy »

Alright, here it is. A new video showing off the changes I made to my script. The climbing feature now utilizes zones instead of step-on NPC's. The zones also only change the characters that are inside that zone.

Video can be seen here:
http://www.youtube.com/watch?v=ZKv4CWw5 ... ZOqoSoxvid



...these videos are kind of monotonous. I'll have to remember to throw in some temporary music for the next screen capture I do.

Oh and also I was wondering how to embed my Youtube videos so they can be watched directly on the forum? I've seen others do it and I think it would just be less of a hassle. I tried just copying and pasting the embed code given on youtube for my video but that doesn't seem to work...
Last edited by sheamkennedy on Tue Sep 24, 2013 5:51 pm, edited 2 times in total.
⊕ 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
Post Reply