Froginator's scripting questions

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Yes, if you want a walkabout larger than 32x40 (the size of hero battle graphics) which animates normally, then unfortunately you will need to script the animation manually. I couldn't find a script on the wiki to do that, but it's actually not bad, if you're ok with a 1-tick delay/lag. The lag is practically unavoidable.
User avatar
Froginator
Slime Knight
Posts: 188
Joined: Thu Apr 24, 2014 10:13 pm
Location: Germany
Contact:

Post by Froginator »

I know I didn't wrote here for a long time, because I got along with my game very smoothly, but now there is another problem to solve, but I think I might have a little too less of programming knowledge to do it by myself.
So here's the problem:
I want to make a giant bird, called Crimson. The player should call him by using an item (simply a flute). But the full party has to be shown on the back of the bird, so the bird must be way larger than 20x20 pixels. The player should also take control over the bird whilst the party is on the bird. I know that this should be made with slices, but I get really confused if I try to do that on my own... so, can someone help men out here? :???:
User avatar
kylekrack
Liquid Metal Slime
Posts: 1188
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

That depends on whether you want the bird to be controlled by the player or not. If not, it's easy to just use a big enemy sprite and then load it in the slice collection editor. Then when you call the script just load the slice collection and animate the bird however necessary.

The walkabouts are 20x20, and the big enemies are 80x80, so it might not work with one big enemy sprite, but in that case you can just spread it over two and set one as a parent to the other. If you want more specifics on how to use the slice editor, just press F1 in the menu, or I can help you out with whatever you need to know.
My pronouns are they/them
Ps. I love my wife
User avatar
Froginator
Slime Knight
Posts: 188
Joined: Thu Apr 24, 2014 10:13 pm
Location: Germany
Contact:

Post by Froginator »

Thanks for the quick reply!
The player should take control over the bird, so 4-directional "flying" is possible. the bird should also change sprites when its moving like he is actually using his wings to fly, and it should also have a sprite for each direction, that you can walk in. Also I think it's better when the bird cannot stop in mid-air, so if you press the UP key, for example, it goes into that direction instead of just lookin' there. I also thought about making an vehicle, but I don't know if slices are possible to use with vehicles...
Last edited by Froginator on Sat Nov 29, 2014 10:36 am, edited 1 time in total.
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Vehicles are just NPCs, and you can change their walkabout slices exactly like a normal NPC.

It seems to me that this question is identical to your last question, about whether you can use walkabout sprites which are larger than 32x40. Since it's a giant bird, I think that the 1-tick lag I talked about may be quite acceptable, which means you can use a pretty simple solution of working out which of the 8 walkabout frames should be shown:

Code: Select all

plotscript, update big bird sprite, npc, begin
  variable(sprite)
  # large enemy spritesets: use spritesets from 50-57
  sprite := 50  # change this!
  sprite += npc direction(npc) * 2 + npc frame(npc)   # 0-7
where 'npc' is the vehicle npc; then you just set the npc walkabout slice to the right large enemy sprite (this bit is like walktall:):

Code: Select all

  variable(sl, pic sl)
  sl := get NPC slice(npc)
  pic sl := lookup slice(sl:walkabout sprite component, sl)
  replace large enemy sprite(pic sl, sprite)
end
Then call the above script every tick:

Code: Select all

while (true) do (    # change this
  update big bird sprite(5)   # change to npc ID number
  wait(1)
)
If you want a sprite which is bigger than 80x80, or has more than 16 colours, then you can just use backdrop slices instead of large enemies!

This is a bit incomplete, but I'm going to bed.
User avatar
msw188
Metal Slime
Posts: 783
Joined: Tue Oct 16, 2007 1:43 am
Location: Los Angeles, CA

Post by msw188 »

Don't forget Froginator wants to have the visual include the four heroes riding. This will require just a bit of extra work, unless the game has predetermined which heroes the player will be using when the bird is called, and you also disallow swapping team order (in which case you can simply draw them as part of a single 'riding big bird' graphic).

My first idea is to have separate slices for the heroes. Have the script check the hero slots one by one, and attach the correct hero slice to the correct spot on the bird one by one. But I've never worked with slices. Is this the best approach?
I am Srime
User avatar
kylekrack
Liquid Metal Slime
Posts: 1188
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

The heroes riding shouldn't be all too complicated to add to the rest of the script. All you should need to do is set them as children to the bird and then set their x,y positions accordingly.

Then you also have to change the heroes directions and positions relative to the bird when the bird changes direction. All you would need to do is update the heroes' positions while you update the bird's.
My pronouns are they/them
Ps. I love my wife
User avatar
Froginator
Slime Knight
Posts: 188
Joined: Thu Apr 24, 2014 10:13 pm
Location: Germany
Contact:

Post by Froginator »

Thanks alot for the help with the bird problem! But I probably wouldn't post something here without having any question, right?
So I wanna make a hookshot-like item. Precisely it's going to be a snake, wich can grab (bite) onto wooden poles or special tiles, and can activate a special kind of lever. Can you help me out here?
Last edited by Froginator on Sat Dec 06, 2014 7:28 pm, edited 1 time in total.
User avatar
kylekrack
Liquid Metal Slime
Posts: 1188
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

Will it only work in straight lines? If so, that will make it much less complicated.

You should be able to use zones pretty effectively here. If you put a zone on the tile that the snake can bite onto, then you can have a script check if the snake is in that zone and then carry out an action.

For example, put zone 1 on a wooden pole, 4 tiles away from the player. Make a script that says when the player uses the snake, create an NPC (or slice) of the snake's head that moves out one tile from the player, in the direction the player is facing. Then have the script check if the snake head is in zone 1. If yes, then have the snake stop, then move the player to the snake (complicated, but let's take this one step at a time). If no, have the snake head move another tile forward, then check again if it's on zone 1, etc.

Code: Select all

plotscript, hoooksnake, begin
     variable(x,y,snakex,snakey,shooting)
     x := hero X(me)
     y := hero Y(me)

     # snake head is an NPC id
     create NPC(snake head,x,y)
     while(shooting) do, begin
          walk NPC(snake head,hero direction(me),1)
          wait for NPC(snake head)
          snakex := NPC x(snake head)
          snakey := NPC y(snake head)
          if(read zone(1,snakex,snakey)) then(
               # pull the player to the snake,
               # and destroy the snake NPCs
               shooting := false
          )
     end
end

Now that I'm looking at this, I don't know that NPCs would work, because of movement zone issues, so you might have to replace all the NPC things with slices. Also, add in something that checks if it's at the edge of the screen, so it doesn't go forever. Sorry this isn't super detailed, but it's past midnight and I just got home. I hope it helps a little.
Last edited by kylekrack on Sun Dec 07, 2014 8:28 am, edited 1 time in total.
My pronouns are they/them
Ps. I love my wife
User avatar
Froginator
Slime Knight
Posts: 188
Joined: Thu Apr 24, 2014 10:13 pm
Location: Germany
Contact:

Post by Froginator »

I want to implement an Earthbound-Style Battle system in my game, but how?
User avatar
RMSephy
Metal Slime
Posts: 356
Joined: Mon Dec 21, 2009 5:56 pm

Post by RMSephy »

1. Start by making a regular Dragon Quest battle system.

2. Drink until the background spins.
User avatar
Froginator
Slime Knight
Posts: 188
Joined: Thu Apr 24, 2014 10:13 pm
Location: Germany
Contact:

Post by Froginator »

xD I laughed so hard that I've nearly slimed myself xD
No I mean the engine not the background
User avatar
Gizmog
Metal King Slime
Posts: 2615
Joined: Tue Feb 19, 2008 5:41 am

Post by Gizmog »

I have a little experience in this department. What you're looking for is going to be fairly difficult. It's going to be a long road, it's going to frustrate the hell out of you and at the end of the day it might not even be worth the while. I don't know if there's any engines out there devoted to an Earthbound/Dragon Warrior kind of battle, but finding one is probably going to be easier than making one.

*IF* you choose to go forward with making one in the OHR, I would urge you to try and half-slime it. Just doing a black backdrop (Or a trippy animated one) and drawing your enemies in that perspective would be a fine start and no one would think less of you for doing it that way. The default battle engine will have a little bit of weirdness (I think there'll be some cursors on the right side of the screen you can't get rid of), but the advantage is that all of the hard parts of targetting, HP, status effects, all of that crap are already done for you and you'll generally have a way nicer time of trying to make stuff happen.

*IF* that is insufficient to your needs and *IF* you're brave enough to try, the solution is going to involve slices for every enemy, slices for every hero, a hell of a lot of scripting and maths for enemy AIs, a hell of a lot of scripting and maths for stuff like poison and stun, and a whole heck of a lot of custom scripting. I've tried something like this twice and it's never worked out very well.

In short, it's going to be hard.
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 »

I think the easiest way to do a Dragon Quest/Earthbound style battle system is to put the built in battle system into "Turn Based" mode, draw enemy sprites facing the screen, and leave hero sprites blank.
User avatar
Urkelbot666
Slime Knight
Posts: 188
Joined: Sat Oct 18, 2014 5:29 pm

Post by Urkelbot666 »

This is also important for first person battles,

--General Game data
--- Preference Bitsets

Image

EDIT: sorry if someone already said this, I didn't read through the entire thread :o
Last edited by Urkelbot666 on Sun Jan 11, 2015 10:57 pm, edited 1 time in total.
Post Reply