Post new topic    
Page «  1, 2, 3, 4, 5, 6, 7, 8  »
Metal King Slime
Send private message
 
 PostSun May 01, 2011 4:33 am
Send private message Reply with quote
NinjaOverdrive wrote:
Can anyone give any more instructions on how slices could be used to create on-screen flashing or flames or whatever?

If you want a flash, you won't need slices. Either use a solid colour backdrop, or tint the palette. By backdrop:
Code:
show backdrop (1)  #whichever
wait (1)
show map

By tinting the palette:
Code:
tweak palette (32, 0, 0)  #increase red value of ever colour in the master palette by 32 (out of 63)
update palette   #actually set as the master palette
wait (1)
reset palette   #reload master palette
update palette

tweakpalette is a pretty limited command, but it's quick and easy.

If you want, say, a big star-shaped white flash for a moment on the screen, you could use a backdrop slice like so (assuming the middle of the screen, and the flash is drawn centered on the backdrop):
Code:
variable (sl)
sl := load backdrop slice (1)  #backdrop num
wait (1)
free slice (sl)


NinjaOverdrive wrote:
I have an NPC set to only appear when Tag 4=On.
I have a script written to make NPC move.

The NPC doesn't move after he appears.

Are you using "npc reference"? If so, you need to call "npc reference" AFTER toggling the tag (the NPC appears instantaneously, without requiring a wait command). NPCs hidden by tags are nearly completely invisible to scripts. If not, maybe post your script?

NinjaOverdrive wrote:
Camera Panning: I have a script that teleports to Map B at point x and I wanted it to scroll to point y. But no matter how much I set the distance for in the script the camera only pans half-way across the map before stopping at the same location each time.

It's not hitting a map edge, is it? Other than that I can't think of anything other than passing the arguments in the wrong order or something like that.

Quote:
Swapping Out/In Heroes: I have set a script "Swap Out Hero (0), Swap In Hero (1), Lock Hero (0)" but after the command the party has not changed.

Note you must always have at least one hero in your party, trying to swap out the only hero will cause some hero to be swapped back in. Also, have you previously added hero 1 to the party and swapped them out? You need to use "add hero" to do that.
Slime Knight
Send private message
 
 PostSun May 01, 2011 7:15 am
Send private message Reply with quote
@TMC,

I fixed the NPC not moving issue by taking out the tag setting in Custom and making the entire thing a scripted event with "Set Tag" in a script.

I also figured out that Swapping In needed to be done before Swapping Out. I guess I'm a tad bit slow on seeing the logical sense behind solutions but I do eventually come to the right answer.

Now, the Pan Camera issue might still be boggling me. I will run some more test on it and testing map restirctions as this seems to be the only reasonable explanation.

Also, I've seen the Tweak Palette command used in the Vikings scripts but am not sure how exactly it works. I will experiment with that command some more in the next couple days as I think a flashing effect would work better than a slice effect. I'll tackle slice effects when I most necessarily need them heh.
Metal Slime
Send private message
 
 PostSun May 01, 2011 2:02 pm
Send private message Reply with quote
If the arguments are being put in the correct order for Pan Camera, maybe you are using the command twice without waiting for the first one to finish...? When I know where I want my camera to end up, I use the command Focus Camera instead.
I am Srime
Slime Knight
Send private message
 
 PostSun May 01, 2011 3:53 pm
Send private message Reply with quote
Here's my panning script bit that isn't working.

Code:

teleport to map (02,34,4)
fade screen in
show text box (14)
focus camera (5,4)
wait for camera
 advance text box
wait (25)
teleport to map (04,1,5)


Is there something wrong with the script?
Super Slime
Send private message
 
 PostSun May 01, 2011 8:17 pm
Send private message Reply with quote
Focus camera takes three arguments.
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Slime Knight
Send private message
 
 PostSun May 01, 2011 8:52 pm
Send private message Reply with quote
Yeah, I'd read that earlier and thought if you didn't specify the third argument it would be default speed.

Anyways, I've modified the script a little but now the camera isn't moving at all and it teleports to the next map.

Code:

# Panning the City
teleport to map (02,34,4)
fade screen in
show text box (14)
focus camera (5,4,8)
wait for camera
wait (90)
teleport to map (04,1,5)


I added the Wait (90) command because it was teleporting to quickly but I think if the Camera commands were working properly then the Wait For Camera should prevent it from teleporting until after the pan command.

Anyways, as I said, the camera isn't moving at all with this command.
Liquid Metal Slime
Send private message
 
 PostSun May 01, 2011 9:04 pm
Send private message Reply with quote
Well, the speed should be divisible by 20, ideally (1,2,4,5,10,20,40,etc.), but besides that, your coordinates puts the camera too close to the map's edge. Anything under 7 is gonna give you problems. Try setting your focus to (8,8) and see if that works.

If you must set it for (5,4), then you'll want to set your map's edge to "Wrap."
Place Obligatory Signature Here
Slime Knight
Send private message
 
 PostSun May 01, 2011 10:18 pm
Send private message Reply with quote
Pepsi, believe you nailed the problem with the edges and wrapping the map. Got it running smoothly! I'm essentially done with the opening sequences now. Phew! At least I think I got a better grip on scripting now.

Thanks everyone!
Slime Knight
Send private message
 
 PostTue May 03, 2011 3:47 am
Send private message Reply with quote
I'm trying to script an event where a short midi song plays when a new character joins the party. There appears to be a way to play a Sound Effect on a text box and end the sound after the box but I could not find a way to play a song and have it end after the box thus I decided to script my own "Join Party" script.

But the song that I set to play loops and then doesn't STOP nor does the ambient music begin to play again.

Code:

plotscript, Gale Join Party,begin
suspend player
suspend box advance
wait (1)
Play Song (11)
Wait (3)
Stop Song
Wait (1)
Get Ambient Music
Show text Box (37)
Wait (20)
Advance Text Box
Swap in Hero (2)
 resume player
 resume box advance
 end


Actually, I got this to working, but is there a way to have the ambient music resume from where it was left off? Can you save the current position of the song and recall it?
Metal King Slime
Send private message
 
 PostTue May 03, 2011 12:06 pm
Send private message Reply with quote
Pepsi Ranger wrote:
Well, the speed should be divisible by 20, ideally (1,2,4,5,10,20,40,etc.), but besides that, your coordinates puts the camera too close to the map's edge. Anything under 7 is gonna give you problems. Try setting your focus to (8,8) and see if that works.


Arggh, I forgot that the camera stops even if the pan is parallel to the map edge if the destination tile is too close to the edge. That is definitely a bug and needs fixing. I know I'm at fault for this one, and worse, have been aware for a long time.

Quote:
Actually, I got this to working, but is there a way to have the ambient music resume from where it was left off? Can you save the current position of the song and recall it?

I'm afraid not. SDL_mixer, which we are currently bound to, is very bad at this, and it doesn't (portably) allow specifying the number of loops of a MIDI either. I can't remember, but I think pausing and resuming music could work, if you use a sound effect instead of a MIDI inbetween.

"get ambient music" doesn't have any side effects (it doesn't actually do anything), it just returns a number. "play song (get ambient music)" would do what you want (although not if the map music is set to "same as last map": see the documentation). But "wait (3)" is an extremely short length of time for a track. That's a sixth of a second.
Slime Knight
Send private message
 
 PostTue May 03, 2011 7:51 pm
Send private message Reply with quote
I got the music for this event set appropriately it just restarts the ambient music from the start but if there's nothing that can be done about that then the script is good as it can be. Oh, and I also realized Get Music only returned the value so, yeah.

Few more things I've been fighting with:

1) I have a text box to add an item. In the Conditions it says "Always, add one of (item)" but whenever I get the item in-game it adds two which I thought in Custom you could only add one item at a time anyways so this puzzled me.

2. When setting a blank NPC on the map is it possible to not have that NPC create an obstruction? I want to place an NPC event on the map that is hidden so the player has to find an item on the ground but the PC is blocked by the blank NPC which defeats the purpose of a "hidden item". I can use Step On to activate but would rather the player have to manually search by keypress.

3. Some of my text boxes, when displayed in-game, do not play the line-text sound effect. Most do but a few do not.

4. When inside a Shop menu (to buy) I do not see the prices for items. Are the prices suppose to show next to the item?
Super Slime
Send private message
 
 PostTue May 03, 2011 8:28 pm
Send private message Reply with quote
NinjaOverdrive wrote:
1) I have a text box to add an item. In the Conditions it says "Always, add one of (item)" but whenever I get the item in-game it adds two which I thought in Custom you could only add one item at a time anyways so this puzzled me.

Do you have "Give Item" on the NPC?

Quote:
2. When setting a blank NPC on the map is it possible to not have that NPC create an obstruction? I want to place an NPC event on the map that is hidden so the player has to find an item on the ground but the PC is blocked by the blank NPC which defeats the purpose of a "hidden item". I can use Step On to activate but would rather the player have to manually search by keypress.

You'll need to script that.

Quote:
4. When inside a Shop menu (to buy) I do not see the prices for items. Are the prices suppose to show next to the item?

The prices are there... they're just probably not where you expect. They don't show up in the item browser on the left.
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Slime Knight
Send private message
 
 PostTue May 03, 2011 8:57 pm
Send private message Reply with quote
Quote:
Quote:
2. When setting a blank NPC on the map is it possible to not have that NPC create an obstruction? I want to place an NPC event on the map that is hidden so the player has to find an item on the ground but the PC is blocked by the blank NPC which defeats the purpose of a "hidden item". I can use Step On to activate but would rather the player have to manually search by keypress.

You'll need to script that.


Ohhhkay. That one sounds a bit tricky. I'm guessing I would need to check hero's x,y coordinates and place it under the If Key Pressed script on the map?
Super Slime
Send private message
 
 PostTue May 03, 2011 9:01 pm
Send private message Reply with quote
And the direction, if you want that.
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Slime Knight
Send private message
 
 PostTue May 03, 2011 9:45 pm
Send private message Reply with quote
I keep forgetting about the Wiki and in-game help docs! I just figured out several new things including the keypress function scripting. Woohoo!

But umm, now that I got this event set up, how do I prevent it from running repeatedly?


EDIT: Steadily adding to my list of of questions.

1) I created a max HP boosting item script. It calls up the Pick Hero menu when you select the item and if you use the item it works fine. But a) if you cancel out of the menu the item becomes disabled. It also becomes disabled after you use it, well, it leaves a blank slot with a x1 in the Item menu and I have to put it in the Trash to get rid of it.
Display posts from previous:
Page «  1, 2, 3, 4, 5, 6, 7, 8  »