Post new topic    
Slime Knight
Send private message
A noble spirit embiggens the smallest man. Walktall script 
 PostSun Nov 02, 2014 6:28 pm
Send private message Reply with quote
Hello again all,
I was recently checking out some of the scripts available in the editor, and became interested in the Walktall script.

I currently only have one Walkabout NPC that I would like to make bigger than the rest, and it only appears on one map.

I have everything set up as far as the actual graphics go, but I'm not entirely sure about what I actually have to insert in to the script.

script, embiggen NPcs, begin
variable(npc, sl)
for(npc, -1, -300, -1) do(
if(get NPC id(npc) >= 0) then(
# this NPC exists
sl := get NPC slice(npc)
embiggen walkabout slice(sl)
)
)
end

I've been having trouble actually figuring out what variables and ID numbers to punch into the script as far as identifying hero sprites and Slice collections.

I realize that this is fairly elementary stuff, but I'm still relatively new to the world of plotscripting, and the game I've been working on uses only a few simple ones so far.

I appreciate any wisdom that anyone would be willing to give on this matter, Thank you all very much Smile
Metal King Slime
Send private message
 
 PostSun Nov 02, 2014 6:51 pm
Send private message Reply with quote
Since you only want to embiggen a single NPC, you should use a version of the embiggen NPCs script like I give below;

You only need to set "map autorun" as the map autorun script for the map with the NPC, but if you read [url="http://rpg.hamsterrepublic.com/ohrrpgce/Scripts:Large_sprites"]Scripts:Large sprites[/url] you will see that you should also set "map autorun" as the on-close script for you main menu. That's the reason that I check the map number in it.

Like the original, you should set the spriteset number to the hero battle spriteset number rather than the walkabout number (but it's easy to specify the spriteset number in the script instead if you prefer).

Code:
plotscript, map autorun, begin
  if (current map == map:the single map) then (   ### Change this
    embiggen NPC(42)  ### Change to correct NPC ID number
  )
  # Add more embiggen NPC calls as desired
end

# Embiggens all copies of a certain NPC ID on the map
script, embiggen NPC, npc ID, begin
  variable(num, npc, sl)
  for (num, 0, npc copy count(npc ID) -- 1) do (
    npc := npc reference(npc ID, num)
    sl := get NPC slice(npc)
    embiggen walkabout slice(sl)
  )
end

script, embiggen walkabout slice, sl, begin
  variable(pic sl, pic num)
  if(sl) then(
    pic sl := lookup slice(sl:walkabout sprite component, sl)
    pic num := get sprite set number(pic sl)   # You can override the spriteset number if desired
    replace hero sprite(pic sl, pic num)
  )
end
Liquid Metal King Slime
Send private message
 
 PostSun Nov 02, 2014 6:54 pm
Send private message Reply with quote
The walktall script should work as is, you shouldn't need to change much of anything for it to work as intended.
Basically, it takes the pic number form the walkabout on an npc or hero and then uses the hero pic with the same number instead of the walkabout.
What you'll want to do to get it working is take the whole script, import it, and then set it up to autorun when you enter all the maps.

NOW, if you only want to embiggen 1 npc, thats a completely different thing. You don't need the walk tall script and in fact it won't do what you want it to do.


Code:
include, plotscr.hsd
plotscript, embiggen heroes, begin

variable(hero, sl, picsl, picnum, npid )

npid:= #enter npc id number
picnum:=  #enter hero pic number

sl := get NPC slice(  npid  )
picsl := lookup slice(sl:walkabout sprite component, sl)
replace hero sprite(picsl, picnum)

end


Just replace #enter npc id number and #enter hero pic number and then import the script, auto run it in the right map and presto. Don't run it without the right npc present though.



EDIT: Looks like TMC beat me to the punch. V
His looks a bit better, might wanna go with his.
Slime Knight
Send private message
 
 PostSun Nov 02, 2014 10:48 pm
Send private message Reply with quote
Thanks to both of you! I was able to get it working with the scripts that you clarified for me, although I'm still not entirely sure how.
Hopefully as I continue to work through this game, I will get more familiar with how scripting works, and script variables in general,

Thanks again!
Slime Knight
Send private message
Em-smallen? 
 PostFri Nov 14, 2014 3:21 pm
Send private message Reply with quote
Just a few quick question on the topic of embiggening. Does the same script also work for other graphics as well? Could I use the same plotscript commands to switch out my Hero's standard walkabout graphic with a smaller one?

I had gotten thinking about the Lost Underworld portion of Earthbound where the hero sprites are tiny to show the massive size of the Dinosaurs wandering about.

Could I do this with the in-battle Hero graphics as well? To have a certain map, or set of battle formations call up a slice that would replace the standard size Hero battle sprites with a set of smaller ones?

This is not regarding anything crucial to the gameplay for the RPG I've been working on, more of just a general curiosity Smile thanks
Metal Slime
Send private message
 
 PostFri Nov 14, 2014 4:13 pm
Send private message Reply with quote
For making a smaller one, I think you would just want to make a smaller sprite in a larger sprite frame. Since all the empty pixels are just transparent anyways, it wouldn't matter much if you only used, say, 16x16 pixels out of a 32x40 dimension sprite.

Or if you mean having certain maps have the standard 20x20 walkabout sprite instead of the walktall 32x40 sprite, just don't use the walktall script for that map. Then, instead of placeholder 20x20 sprites, do actual sprites. I'll be doing this in my game for the overworld, sort of like Chrono Trigger.

For having specific hero graphic changes for certain maps, I think the plotscript command is 'change hero graphic' or something similar, but basically you would want that particular map or set of battle formations have a script that would change your hero graphics to a smaller set.

EDIT:
It's actually this, I think. I was way off. http://hamsterrepublic.com/ohrrpgce/docs/plotdict.xml#about-setheropicture
Slime Knight
Send private message
 
 PostFri Nov 14, 2014 8:27 pm
Send private message Reply with quote
Thanks Foxley! With the exception of a few larger characters, I've been using standard size walkabouts. I just got to thinking about making some monsters appear gigantic by using the walktall script in conjunction with switching the hero's walkabout with another standard size one, which would utilize less of the available pixels.

Seems like everything I asked about is quite possible, maybe if I get ambitious, I'll give some of this stuff a try
Slime Knight
Send private message
 
 PostSat Nov 15, 2014 12:11 am
Send private message Reply with quote
I just wanted to follow up on this post, and say that I have, so far, had great success with these scripts!

I tested it in a map, and it worked just like I hoped. I went to the map, and there were giant, 'walktall' monsters wandering around, and my hero was a teeny tiny little man. I got into a battle, and my hero sprite was replaced with the miniature one I made.

I see that there are also scripts to place the x,y coordinates of the hero's hand as well, I guess that will be the next step so his sword isn't floating above his head when he attacks V

I imagine I'll have to add an autorun script on a few other maps to return the hero to normal size, as I have a Dragon Warrior style "return" spell which the player could use to teleport out of the giant land map... unless I can just add that script to my teleportation scripts... hmmm. things to think about. Anyway..

Thanks again for everyone's help on all the inane scripting questions I've been asking lately.
Display posts from previous: