 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
jabbercat Composer

Joined: 04 Sep 2003 Posts: 823 Location: Oxford
|
Posted: Wed Sep 10, 2003 9:41 pm Post subject: |
|
|
here are my scripts define script (1,randomize stats,0)
define script (2,turnsmap0,none)
define script (3,playerflowctrl,none)
define script (4,exeperence1,none)
define script (5,enemyHpandatt1,1,0)
define script (6,herodeathscript,none)
define script (7,wonder,none)
globalvariable(1,experence)
globalvariable(2,herohp)
globalvariable(3,heroattack)
globalvariable(4,enemyatt1)
globalvariable(5,enemyHP1)
#----------------------------------------------------------------------------
script,randomize stats,begin
pick hero
set hero stat (me,stat:HP ,random(70,110),maximumstat)
set hero stat (me,stat:MP ,random(10,40) ,maximumstat)
set hero stat (me,stat:Atk,random(20,30) ,maximumstat)
set hero stat (me,stat:Aim,random(20,30) ,maximumstat)
set hero stat (me,stat:Def,random(20,30) ,maximumstat)
set hero stat (me,stat:Dog,random(20,30) ,maximumstat)
set hero stat (me,stat:Mag,random(20,30) ,maximumstat)
set hero stat (me,stat:Wil,random(20,30) ,maximumstat)
set hero stat (me,stat:Spd,random(15,25) ,maximumstat)
set hero stat (me,stat:MP~,random(0 ,10) ,maximumstat)
writeglobal(2,20)
writeglobal(5,5)
end
#----------------------------------------------------------------------------
script, turnsmap0, begin
while (current map == 0) do, begin #edit for map no.
if (hero is walking (me)) then (resume npcs) else (suspend npcs)
wait (1)
end
end
#----------------------------------------------------------------------------
script,playerflowctrl,begin
if(heroiswalking(me)==true)then(wait(20),suspendplayer,wait(20)
if(suspendplayer==true)then(wait(20),resumeplayer,wait(20))
end
end
#----------------------------------------------------------------------------
script,exeperence1,begin
if(readglobal(5),>>,0)then( setvariable(experence,experence+1))
if(readglobal(5),>>,0)then( showtextbox(2))
if(readglobal(1),>>,10)then( setvariable(herohp,herohp+10))
if(readglobal(1),>>,20)then( setvariable(herohp,herohp+30))
if(readglobal(1),>>,30)then( setvariable(herohp,herohp+50))
if(readglobal(1),>>,40)then( setvariable(herohp,herohp+100))
if(readglobal(1),>>,50)then( setvariable(herohp,herohp+110))
if(readglobal(1),>>,10)then( showtextbox(1))
if(readglobal(1),>>,20)then( showtextbox(1))
if(readglobal(1),>>,30)then( showtextbox(1))
if(readglobal(1),>>,40)then( showtextbox(1))
if(readglobal(1),>>,50)then( showtextbox(1))
end
#----------------------------------------------------------------------------
script,enemyHpandatt1,who,begin
resume npcs,setvariable(enemyHP1,enemyHP1--1),setvariable(herohp,herohp--1),suspendNpcs
if(readglobal(5),<=,0)then(destroyNPC(who),wait(40),writeglobal(1,readglobal(5)+5))
end
#------------------------------------------------------
script,herodeathscript,begin
show backdrop(1)
wait(40)
game over
end
#---------------------------------------
script, wonder, begin
variable(number)
setvariable(number,random(1,20))
if (number==1) then (setheropalette(me,3),setheropicture(me,3),showtextbox(7))
if (number==2) then (setheropalette(me,4),setheropicture(me,4),showtextbox( )
if (number==3) then (setheropalette(me,4),setheropicture(me,5) ,showtextbox(9))
if (number==4) then (setheropalette(me,5),setheropicture(me,6) ,showtextbox(10))
if (number==5) then (setheropalette(me,5),setheropicture(me,7) ,showtextbox(11))
if (number==6) then (setheropalette(me,4),setheropicture(me, ,showtextbox(12))
if (number==7) then (setheropalette(me,5),setheropicture(me,9) ,showtextbox(13))
if (number== then (setheropalette(me,6),setheropicture(me,10) ,show text box(14))
if (number==9) then (setheropalette(me,5),setheropicture(me,12) ,show text box(16))
if (number==10) then (setheropalette(me,5),setheropicture(me,14) ,show text box(1 )
if (number==11) then (setheropalette(me, ,setheropicture(me,16) ,showtextbox(19))
if (number==12) then (settag(5),showtextbox(22))
if (number==13) then (getmoney(1))
if (number==14) then (getmoney(1))
if (number==15) then (getmoney(1))
if (number==16) then (getmoney(1))
if (number==17) then (getmoney(1))
if (number==1 then (getmoney(1))
if (number==19) then (getmoney(1))
if (number==20) then (getmoney(1))
settag(6,off)
end
end
terrible oui ?  _________________ Moogle no longer owes prizes. |
|
Back to top |
|
 |
Setu_Firestorm Music Composer

Joined: 26 Mar 2003 Posts: 2566 Location: Holiday. FL
|
Posted: Thu Sep 11, 2003 12:30 am Post subject: |
|
|
Woah, there! You're just diving right into the advanced stuff. You're dealing with things I don't even mess with (but probably will at some point).
Unless you're a programmer, I would recommend going a lot simpler first til you get your feet wet. I'm not saying that to be offensive, I'm just saying that if somebody like Aeth or Cube try to explain that to you, you might now know what they're talking about. Shoot, I don't even understand the scripting you wrote, `cause I don't mess with Global Variables that much. _________________
Facebook: http://www.facebook.com/georgerpowell
Newgrounds: http://setu-firestorm.newgrounds.com |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Thu Sep 11, 2003 9:42 am Post subject: |
|
|
So... everything sorted out? Is there anything wrong with those scripts? _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Flamer The last guy on earth...

Joined: 04 Feb 2003 Posts: 725 Location: New Zealand (newly discovered)
|
Posted: Thu Sep 11, 2003 10:10 am Post subject: |
|
|
nice scripting, though there would be one thing... too many if's...
like Quote: | if(readglobal(5),>>,0)then( setvariable(experence,experence+1))
if(readglobal(5),>>,0)then( showtextbox(2)) |
could be written as.
if(readglobal(5)>>0) then(setvariable(experience,experience+1)
show textbox(2))
i dunno, it just looks more clean than having all those if's with the same condition and no changes in the other if statements that could possibly change the condition. _________________ If we were a pack of dogs, IM would be a grand Hound, CN would be a very ficious little pitball, and Giz...well, it doesn't matter breed he is, he'd still be a bitch
(no offense to anyone that was mentioned) |
|
Back to top |
|
 |
jabbercat Composer

Joined: 04 Sep 2003 Posts: 823 Location: Oxford
|
Posted: Thu Sep 11, 2003 11:11 am Post subject: |
|
|
The Mad Cacti wrote: | So... everything sorted out? Is there anything wrong with those scripts? |
nay lord... enemyHpandatt1 isnt working its supposed to kill the NPC when its global variable is 0 or lower (its supposed to replace battles and that reminds me thet the randomizestat script is dogmeat) and then restore the vaiable to 5 for the rest of the monsters and i dont know if the experence script works because I cant kill the monsters with my enemyHPandatt1 script
ps:my numbers were replaced by smiles  _________________ Moogle no longer owes prizes. |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri Sep 12, 2003 11:51 am Post subject: |
|
|
Well, I can't quite see why the enemyHpandatt1 script doesn't work, but why are you using
'writeglobal(1,readglobal(5)+5))'
I thought that global 5 (you could just use 'enemyHP1') would be zero anyway. Prehaps you want to increase the amount of experience the hero has?
'set variable(experence, experence + 5)'
As for your randomize stats script, 'pick hero' does nothing by itself. It doesn't set the choosen hero to be the leader, it returns the hero choosen by their postion in the party.. you might want
Code: |
script,randomize stats,begin
variable (hero no)
hero no := pick hero
set hero stat (hero no,stat:HP ,random(70,110),maximumstat)
set hero stat (hero no,stat:MP ,random(10,40) ,maximumstat)
set hero stat (hero no,stat:Atk,random(20,30) ,maximumstat)
..etc..
|
_________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
jabbercat Composer

Joined: 04 Sep 2003 Posts: 823 Location: Oxford
|
Posted: Fri Sep 12, 2003 9:22 pm Post subject: |
|
|
yeah .. that script became redundant because I relise that there are no battles so theres no point in a randomize stats script  _________________ Moogle no longer owes prizes. |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sat Sep 13, 2003 10:50 am Post subject: |
|
|
Oh, yeah.....
Well, can you explain what isn't working about the enemyHpandatt1 script? _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
jabbercat Composer

Joined: 04 Sep 2003 Posts: 823 Location: Oxford
|
Posted: Sat Sep 13, 2003 12:04 pm Post subject: |
|
|
well enemyhpandatt1 is to replace battles so when activate an NPC that runs that script will bring up a text box and say "you have hit the monster and the monster hit you" so for this enemy you have to activate it like 5 time for it to be destoryed but when testing the script I hit it like 20,000 time and nothing  _________________ Moogle no longer owes prizes. |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Mon Sep 15, 2003 9:03 am Post subject: |
|
|
Well, you can take out the resume and suspend npc commands. Since their right after one another, they don't do anything.
I don't see what
writeglobal(1,readglobal(5)+5)
is meant to do if the enemy's HP is 0, but I can't see what wrong with the script... _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
jabbercat Composer

Joined: 04 Sep 2003 Posts: 823 Location: Oxford
|
Posted: Mon Sep 15, 2003 11:33 am Post subject: |
|
|
well I used writeglobal so that when the Npc is dead that it would restore the global variable for other NPCs to be attacked _________________ Moogle no longer owes prizes. |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Mon Sep 15, 2003 1:01 pm Post subject: |
|
|
Ah... Well in that case, shouldn't it be
writeglobal(5,5)
? Global 1 is your experience.... _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
jabbercat Composer

Joined: 04 Sep 2003 Posts: 823 Location: Oxford
|
Posted: Tue Sep 16, 2003 9:39 pm Post subject: |
|
|
still nothing  _________________ Moogle no longer owes prizes. |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Tue Sep 16, 2003 11:33 pm Post subject: debugging magic |
|
|
Want a nice way to see what is happening with your global variables? In your
"you have hit the monster and the monster hit you"
text box, use ${V#} to show global variables.
example text box:
Code: |
you have hit the monster and the monster hit you
${V1} experence
${V2} herohp
${V3} heroattack
${V4} enemyatt1
${V5} enemyHP1
|
Also, I notice you are using "read global" and "write global" alot for no reason.
Code: |
if(readglobal(1),>>,10)then( showtextbox(1))
|
Why not write:
Code: |
if(experence,>>,10)then( showtextbox(1))
|
The whole point of using the:
Code: |
globalvariable(1,experence)
|
command is to give an easy to read easy to remember name to global variable ID #1. The only reason you would ever need to use "read global" or "write global" is to access global variables that you have never given a name with a "global variable" command. |
|
Back to top |
|
 |
jabbercat Composer

Joined: 04 Sep 2003 Posts: 823 Location: Oxford
|
Posted: Wed Sep 17, 2003 11:01 pm Post subject: |
|
|
I put the global variable in to teh text and it went down in the -'s and still nothing! _________________ Moogle no longer owes prizes. |
|
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
|