Post new topic    
Liquid Metal Slime
Send private message
Small Problem With Making Hero Appear at (X,Y) 
 PostTue May 06, 2014 7:12 pm
Send private message Reply with quote
I'm having a problem getting my hero to appear at the given (x,y) coordinates after the animation occurs. The code thus far is:

Code:
#This shows the animation
#Frames 1 to 27
for(i, 1, 27) do(
  sl := lookup slice(sliceNum, collection)
  put slice (sl, camera pixel X, camera pixel Y)
  set parent (sl, slParent)
  set slice visible (sl, on)
  wait(4)
  set slice visible (sl, off)
  slicenum := (sliceNum + 1)
  free slice (sl)
 )
 
#This makes the hero appear at the (x,y) coordinate at the end
#of the animation. This also replaces the default "Coyote"
#character with "Plume" from the animation, then proceeds
#to have her face right and talk to "Jinso"
  #Makes Plume Appear after animations
  set hero position (me, 11, 10)
  add hero (1)
  swap by position (1, 2)
  swap out hero (2)
  embiggen now
  wait(3)
  set hero direction (me, right)
  focus camera (11, 10, 1)
  wait for camera
 
  #Dialogue b/w Jinso and Plume
  show text box (8)
  wait for text box
  show text box (9)
  wait for text box


Here's a video of what actually happens:
https://www.youtube.com/watch?v=jWYGABBXxmI&feature=youtu.be

As far as I can tell, this should perform the animation, then put my hero where the animation character lands, then replace them with the correct hero. Though is seems like none of this is happening. In the video, the hero remains a coyote, and does not change to that (x,y) position....
⊕ 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
Liquid Metal Slime
Send private message
 
 PostTue May 06, 2014 7:29 pm
Send private message Reply with quote
I just realized I was improperly referring to my heroes. Here's my new code, but even after changing it I'm still getting the same results...

Code:
#Frames 1 to 27
for(i, 1, 27) do(
  sl := lookup slice(sliceNum, collection)
  put slice (sl, camera pixel X, camera pixel Y)
  set parent (sl, slParent)
  set slice visible (sl, on)
  wait(4)
  set slice visible (sl, off)
  slicenum := (sliceNum + 1)
  free slice (sl)
 )
 
  #Makes Plume Appear after animations
  set hero position (1, 11, 10)
  add hero (hero:Plume)
  swap by position (1, 2)
  swap out hero (hero:Coyote)
  embiggen now
  wait(3)
  set hero direction (1, right)
  focus camera (11, 10, 1)
  wait for camera
 
  #Dialogue b/w Jinso and Plume
  show text box (8)
  wait for text box
  show text box (9)
  wait for text box

⊕ 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
Liquid Metal King Slime
Send private message
 
 PostTue May 06, 2014 7:38 pm
Send private message Reply with quote
I'll start by saying that hero adding/swapping can sometimes act differently than how you'df expect it to and may require you to try things a couple different ways before finding the exact way to word things in order to get things just right.

That said, without looking too closely at this, or doing any sort of test cases or anything, I'd guess;

swap by position (1, 2)
instead of
swap by position (0, 1)


Or possibly something to do with the embiggen now script.
Liquid Metal King Slime
Send private message
 
 PostTue May 06, 2014 7:52 pm
Send private message Reply with quote
I don't think there is enough information in the code you posted for me to be able to tell what is going on here. The only references to heroes are in this part:

Code:

  set hero position (1, 11, 10)    # hero at walkabout rank 1
  add hero (hero:Plume)           # hero with ID hero:Plume
  swap by position (1, 2)           # heroes 1 and 2 by party slot
  swap out hero (hero:Coyote)  # hero by ID hero:Coyote
  embiggen now
  wait(3)
  set hero direction (1, right)     # hero in walkabout rank 1
  focus camera (11, 10, 1)
  wait for camera


I went through each command and looked up each command in http://rpg.hamsterrepublic.com/ohrrpgce/Ways_to_refer_to_a_hero_in_a_script to see which of the three kinds of hero references each of these commands expects.

But the code you posted seems like only a tiny part of the sequence in the video, and I am not entirely sure which part it is.
Liquid Metal Slime
Send private message
 
 PostTue May 06, 2014 8:12 pm
Send private message Reply with quote
@Spoonweaver: I tried both of what you suggested. By switching the ranks so they refer to the right hero by rank. 0 instead of 1...etc. Which makes my new code:

Code:
 #Makes Plume Appear after animations
  set hero position (0, 11, 10)
  add hero (hero:Plume)
  swap by position (0, 1)
  swap out hero (hero:Coyote)
  #embiggen now
  wait(3)
  set hero direction (0, right)
  focus camera (11, 10, 1)
  wait for camera


Notice that I removed embiggen too. The results are still the same though, it does not seem to be placing any hero at that position. And the Coyote character still remains up around the map origin.



@Bob: The code I posted refers to time 0:34 to 0:43 in the video in which the second character slides down the rope and jumps off of the ledge. When she hits the ground, the last slice in the animation is deleted and supposed to be replaced with the corresponding hero at that (x,y). I can give you the full cutscene code, but it doesnt refer to the heroes asides from this segment.

Code:
script, sunkenA_ScanAcross, begin
  suspend player
  suspend random enemies
  suspend caterpillar
  suspend NPCs
 
  put camera (1280, 104)
  focus camera (28, 10, 1)
  wait for camera
  focus camera (7, 7, 1)
  wait for camera
  wait(30)
 
variable(collection, sl, slParent, i, sliceNum)

###Grappling Hook in to Wall animation
collection := load slice collection(5)
slParent := lookup slice(sl:map layer6)
sliceNum := 73           # Must equal the lookup code in the engine

#Frames 1 to 7
for(i, 1, 7) do(
  sl := lookup slice(sliceNum, collection)
  put slice (sl, camera pixel X, camera pixel Y)
  set parent (sl, slParent)
  set slice visible (sl, on)
  wait(3)
  set slice visible (sl, off)
  slicenum := (sliceNum + 1)
  free slice (sl)
)

#Frames 8
  sl := lookup slice(sliceNum, collection)
  put slice (sl, camera pixel X, camera pixel Y)
  set parent (sl, slParent)
  set slice visible (sl, on)
  wait(3)

###Jinso Down Rope Animation
collection := load slice collection(4)
slParent := lookup slice(sl:map layer6)
sliceNum := 59           # Must equal the lookup code in the engine

#Frames 1 to 5
for(i, 1, 5) do(
  sl := lookup slice(sliceNum, collection)
  put slice (sl, camera pixel X, camera pixel Y)
  set parent (sl, slParent)
  set slice visible (sl, on)
  wait(3)
  set slice visible (sl, off)
  slicenum := (sliceNum + 1)
  free slice (sl)
)

#Frames 6 to 7
for(i, 1, 2) do(
  sl := lookup slice(sliceNum, collection)
  put slice (sl, camera pixel X, camera pixel Y)
  set parent (sl, slParent)
  set slice visible (sl, on)
  wait(2)
  set slice visible (sl, off)
  slicenum := (sliceNum + 1)
  free slice (sl)
)

#Frames 8 to 10
for(i, 1, 3) do(
  sl := lookup slice(sliceNum, collection)
  put slice (sl, camera pixel X, camera pixel Y)
  set parent (sl, slParent)
  set slice visible (sl, on)
  wait(4)
  set slice visible (sl, off)
  slicenum := (sliceNum + 1)
  free slice (sl)
)

#Frames 11 to 12
for(i, 1, 2) do(
  sl := lookup slice(sliceNum, collection)
  put slice (sl, camera pixel X, camera pixel Y)
  set parent (sl, slParent)
  set slice visible (sl, on)
  wait(4)
  set slice visible (sl, off)
  slicenum := (sliceNum + 1)
  free slice (sl)
)

#Frames 13 to 14
for(i, 1, 2) do(
  sl := lookup slice(sliceNum, collection)
  put slice (sl, camera pixel X, camera pixel Y)
  set parent (sl, slParent)
  set slice visible (sl, on)
  wait(5)
  set slice visible (sl, off)
  slicenum := (sliceNum + 1)
  free slice (sl)
)

  #Makes Jinso Appear after animations 
  create NPC (4, 13, 10, right)
  embiggen now
  wait(3)
  set NPC direction (4, down)
  wait(3)
  set NPC direction (4, left)
 
###Plume Down Rope
collection := load slice collection(6)
slParent := lookup slice(sl:map layer6)
sliceNum := 81           # Must equal the lookup code in the engine

#Frames 1 to 27
for(i, 1, 27) do(
  sl := lookup slice(sliceNum, collection)
  put slice (sl, camera pixel X, camera pixel Y)
  set parent (sl, slParent)
  set slice visible (sl, on)
  wait(4)
  set slice visible (sl, off)
  slicenum := (sliceNum + 1)
  free slice (sl)
 )
 
  #Makes Plume Appear after animations
  set hero position (0, 11, 10)
  add hero (hero:Plume)
  swap by position (0, 1)
  swap out hero (hero:Coyote)
  #embiggen now
  wait(3)
  set hero direction (0, right)
  focus camera (11, 10, 1)
  wait for camera
 
  #Dialogue b/w Jinso and Plume
  show text box (8)
  wait for text box
  show text box (9)
  wait for text box
   
  #Makes Jinso Climb Down Ladder
  walk NPC (4, down, 1)
  wait for NPC (4)
  walk NPC (4, left, 2)
  wait for NPC (4)
  walk NPC (4, down, 9)
  wait for NPC (4)
 

 
  camera follows hero (2)
 
  resume player
  resume random enemies
  resume caterpillar
  resume NPCs
end

⊕ 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
Liquid Metal King Slime
Send private message
 
 PostTue May 06, 2014 8:27 pm
Send private message Reply with quote
here's my second stab in the dark.

set hero position (me, 11, 10)
add hero (1)
swap by position (1, 2)
swap out hero (2)


*
| add hero (1)
| swap by position (1, 2)
| swap out hero (2)
L>set hero position (me, 11, 10)
Liquid Metal King Slime
Send private message
 
 PostTue May 06, 2014 8:35 pm
Send private message Reply with quote
So in the rope sliding animation, are you using slices with the same sprites as heroes, with the real heroes hidden somewhere?
Liquid Metal Slime
Send private message
 
 PostTue May 06, 2014 8:45 pm
Send private message Reply with quote
Bob the Hamster wrote:
So in the rope sliding animation, are you using slices with the same sprites as heroes, with the real heroes hidden somewhere?


No. The slices being used are all backdrop slices being displayed one-by-one on the screen. The hero "Coyote" is present at the maps origin so he is out of sight. I am just trying to move him to the spot where the animated character lands, then swap him out of the party, and swap her sprite in. As a result, I want it to look like she lands, then stands in the spot where she has landed. After the dialogue I want the player to then take control of her.
⊕ 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
Liquid Metal Slime
Send private message
 
 PostTue May 06, 2014 8:56 pm
Send private message Reply with quote
Figured it out! You guys are going to hate me. The problem was that I backed up my game and script last night. My text editor opened the backup script from my dropbox instead of the script I was editing, so all my edits literally had no effect. The script was fine to begin with asides from the off by one error that Spoonweaver pointed out.

Thanks both of you. Sorry about that.
⊕ 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
Liquid Metal King Slime
Send private message
 
 PostWed May 07, 2014 3:48 am
Send private message Reply with quote
Aha! I am glad to know you resolved the trouble! This was really puzzling me

By the way, I really love the way the grappling hook animation looks.
Metal King Slime
Send private message
 
 PostWed May 07, 2014 5:30 am
Send private message Reply with quote
Bob the Hamster wrote:
I went through each command and looked up each command in http://rpg.hamsterrepublic.com/ohrrpgce/Ways_to_refer_to_a_hero_in_a_script to see which of the three kinds of hero references each of these commands expects.


You admit it! Even you can't remember every time!

Quote:
My text editor opened the backup script from my dropbox instead of the script I was editing, so all my edits literally had no effect.


I've made the same mistake several times.
Liquid Metal King Slime
Send private message
 
 PostWed May 07, 2014 2:24 pm
Send private message Reply with quote
I helped!

V
Liquid Metal King Slime
Send private message
 
 PostWed May 07, 2014 3:30 pm
Send private message Reply with quote
TMC wrote:
Bob the Hamster wrote:
I went through each command and looked up each command in http://rpg.hamsterrepublic.com/ohrrpgce/Ways_to_refer_to_a_hero_in_a_script to see which of the three kinds of hero references each of these commands expects.


You admit it! Even you can't remember every time!


Haha! Guilty as charged! I remembered most of them, but I had to look up "swap by position" just to be sure :)
Display posts from previous: