 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
Misac Lone Game Dev

Joined: 09 Aug 2005 Posts: 27 Location: São Paulo, Brazil
|
Posted: Fri Dec 12, 2008 3:19 am Post subject: A little help with a bit complex Script |
|
|
i need a Script that when you run it will consume your MP (or stamina)
and a script that make a layer apears after a brief period (i will make Weather efects whit this), some one know how?
I almost Forgot! make the player shot and damege NPC's and then make Some NPC's shot too and the Player Take demage, I am Resuming The "GTA conected" Project and so it will take a lot of scripts...
Thanks for the attention! _________________
"Live and Inoperative" |
|
Back to top |
|
 |
Calehay ...yeah. Class B Minstrel

Joined: 07 Jul 2004 Posts: 549
|
Posted: Fri Dec 12, 2008 6:40 pm Post subject: Re: A little help with a bit complex Script |
|
|
Misac wrote: | i need a Script that when you run it will consume your MP (or stamina) |
As in run on the map, or from a battle?
Quote: | and a script that make a layer apears after a brief period (i will make Weather efects whit this), some one know how? |
I'm assuming you're talking about layer 2. If you want all the effect to pop up simulatneously all across the map, it's easy. Just place the layer 2 tiles on the map as if you would see if during the effect, make sure you have an empty tileset, then do a script something like this: (ran as a auto run script on the map)
Code: | plotscript, weathereffect, begin
variable (done)
done := false
load tileset (x, 2) #Where "x" is the number of the blank tileset
while (done == false) do
(
wait (120) #Or however long you want the effect off the screen
load tileset (y, 2) #Where "y" is the number of your weather tileset
wait (30) #Or however long you want the effect on the screen
load tileset (x, 2)
#Now, insert a condition that makes the weather stop if needed.
If (blargh) then #blargh should be replaced with approriate condition
( #such as "if (tag:stoprain == on) then"
done := true
)
)
end |
If you want something more complex, like effects appearing on different parts of the screen at once, it gets a bit more difficult. _________________ Calehay |
|
Back to top |
|
 |
Misac Lone Game Dev

Joined: 09 Aug 2005 Posts: 27 Location: São Paulo, Brazil
|
Posted: Sun Dec 14, 2008 12:31 pm Post subject: |
|
|
yep this what i want And the "runing script" is for the map
but about the shoting? someone Know how to? _________________
"Live and Inoperative" |
|
Back to top |
|
 |
Gizmog1 Don't Lurk In The Bushes!

Joined: 05 Mar 2003 Posts: 2257 Location: Lurking In The Bushes!
|
Posted: Mon Dec 15, 2008 8:22 am Post subject: |
|
|
Why don't you try writing it on your own, and then if you get stuck, post the script and we can help point you in the right direction? |
|
Back to top |
|
 |
Misac Lone Game Dev

Joined: 09 Aug 2005 Posts: 27 Location: São Paulo, Brazil
|
Posted: Mon Dec 15, 2008 11:04 am Post subject: |
|
|
Well this is the point! i don't know how to do some of them
see
Code: | include, plotscr.hsd
define script(1,night,0)
script,night,begin
wait (25920)
load tileset (4,0)
wait (25920)
load tileset (0,0)
end |
i don't know how to make it loop and using variables like calehay do only gives me a black screen
and the runing script and shoting script i dont know Even how to start it, i'm not good whit plotscripts like this but i understand whit some observation _________________
"Live and Inoperative" |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Mon Dec 15, 2008 1:12 pm Post subject: |
|
|
That's why there are resources for people in your situation. _________________
|
|
Back to top |
|
 |
Calehay ...yeah. Class B Minstrel

Joined: 07 Jul 2004 Posts: 549
|
Posted: Mon Dec 15, 2008 9:10 pm Post subject: |
|
|
Misac wrote: |
i don't know how to make it loop and using variables like calehay do only gives me a black screen |
I just tested it and it worked perfectly. Can you post the script the way you put it in yours?
Quote: | Code: | include, plotscr.hsd
define script(1,night,0)
script,night,begin
wait (25920)
load tileset (4,0)
wait (25920)
load tileset (0,0)
end |
|
This would not work because you're loading your weather tileset as layer 0. The second argument in the load tileset command is the layer you want that tileset to be loaded to. You also have to make sure that you've enabled the second layer on that map in custom. (Also, remember that, for the second layer, the top left corner tile will be transparent, even if there's graphics there. I've made that mistake far too often.)
The effect would also only run once, and then finish. Flow control commands are very useful, and I suggest learning them before trying to tackle these other massive scripts, because you will definitely need them.
Also, wait (25920) is around 24 minutes. One tick is roughly 1/18th of a second. _________________ Calehay |
|
Back to top |
|
 |
Misac Lone Game Dev

Joined: 09 Aug 2005 Posts: 27 Location: São Paulo, Brazil
|
Posted: Tue Dec 16, 2008 8:15 am Post subject: |
|
|
Yep 24 minutes, is the time between day and night on most games, but for the weather i was using this one
Code: | script,Rain,begin
variable (done)
done := false
load tileset (2, 2)
while (done == False) do
(
wait (180)
load tileset (3, 2)
wait (100)
load tileset (2, 2)
end) |
i see i figured out what was Causing the problem i was forgoten the "()"and well, i need these scripts to load on Map auto run, it is posible to use 2 in 1?
and how about the shoting script? _________________
"Live and Inoperative"
Last edited by Misac on Tue Dec 16, 2008 8:41 am; edited 1 time in total |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Tue Dec 16, 2008 8:39 am Post subject: |
|
|
Only one script at a time can run, so you might be better of using timers rather than big long wait() commands.
Code: |
include, plotscr.hsd
plotscript, become day, begin
load tileset(0,0)
set timer(0, 1, 25920, @become night)
end
plotscript, become night, begin
load tileset(4,0)
set timer(0, 1, 25920, @become day)
end
|
Just run "become day" at the beginning. It will load the daytime tileset into map layer 0, and then it will start timer 0 counting down for 24 minutes. After timer 0 runs out it will trigger "become night" and reset the timer for another 24 minutes. When that runs out, it triggers "become day", and so-on.
There are no "wait" commands involved, so this will not interfere with any other scripts, nor will any other scripts interfere with it.
Your rain script can be approached the same way, but you will need a different timer.
Code: |
plotscript, start rain, begin
load tileset (2, 2)
set timer (1, 1, 180, @slow rain)
end
plotscript, slow rain, begin
load tileset (3, 2)
set timer (1, 1, 100, @stop rain)
end
plotscript, stop rain, begin
load tileset (2, 2)
end
|
See? This one uses timer number 1. You run "start rain" in your map autorun script. It sets the timer for "slow rain", and that sets the timer for "stop rain"
You can have up to 16 different timers going at any time (numbered 0 to 15) |
|
Back to top |
|
 |
Misac Lone Game Dev

Joined: 09 Aug 2005 Posts: 27 Location: São Paulo, Brazil
|
Posted: Tue Dec 16, 2008 8:59 am Post subject: |
|
|
well based on what you show, i see that is posible to trigger a script whit a comand, so i tried this
Code: | define script(1,rain,0)
define Script(2,night,0)
script,rain,begin
@night
variable (done)
done := false
load tileset (2, 2)
while (done == False) do
(
wait (180)
load tileset (3, 2)
wait (100)
load tileset (2, 2)
end)
script,night,begin
variable (var1)
var1 := false
while (var1 == false) do
(
wait (36)
load tileset (4,0)
wait (36)
load tileset (0,0)
end) |
i'm not sure if it's correct but i think i'm losing something _________________
"Live and Inoperative" |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Tue Dec 16, 2008 10:03 am Post subject: |
|
|
Code: | define script(1,rain,0)
define Script(2,night,0) |
These are not needed anymore. You can make things easier on yourself if you read 'How do I convert my scripts from old to new syntax?'
Code: |
script,rain,begin
night
variable (done)
|
To call one script from another you just use the name. You do not need the @ sign. The @ sign is special for "set timer"
Code: |
while (done == False) do
(
wait (180)
load tileset (3, 2)
wait (100)
load tileset (2, 2)
end)
|
The way you have written your script, none of this will happen until the "night" script is completely finished. You cannot make two scripts run at the same time, even if they use "wait" commands.
That is why I am suggesting that you should use timers for your day/night and weather effects instead of wait commands.
Your script should be something like this:
Code: |
plotscript, map autorun, begin
become day
start rain
end
plotscript, become day, begin
load tileset(0,0)
set timer(0, 1, 25920, @become night)
end
plotscript, become night, begin
load tileset(4,0)
set timer(0, 1, 25920, @become day)
end
plotscript, start rain, begin
load tileset (2, 2)
set timer (1, 1, 180, @slow rain)
end
plotscript, slow rain, begin
load tileset (3, 2)
set timer (1, 1, 100, @stop rain)
end
plotscript, stop rain, begin
load tileset (2, 2)
end
|
|
|
Back to top |
|
 |
Misac Lone Game Dev

Joined: 09 Aug 2005 Posts: 27 Location: São Paulo, Brazil
|
Posted: Tue Dec 16, 2008 10:25 am Post subject: |
|
|
wow Thanks this make me understand! the last time since i used Scripts was on ubertzung. thanks a lot paige but i still need the shoting Script know like on GTA 2 _________________
"Live and Inoperative" |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri Dec 19, 2008 2:06 am Post subject: |
|
|
Your second request is much harder. You want to give NPC's HP and make them shoot at you whenever they face you? I've never seen any non-sidescrolling game actually do that (aside from a minigame in SoJ which was scrapped because it ran too slowly or something like that), so I don't think anyone has a script like that to give you. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Misac Lone Game Dev

Joined: 09 Aug 2005 Posts: 27 Location: São Paulo, Brazil
|
Posted: Fri Dec 26, 2008 6:55 am Post subject: |
|
|
Moogle made something like this on OHR Tactics. But the attacks will ocur on Key Press _________________
"Live and Inoperative" |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Fri Dec 26, 2008 8:48 am Post subject: |
|
|
Yes, and it was a very complicated script. You're essentially asking someone to program your game for you here. _________________
|
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|