View previous topic :: View next topic |
Author |
Message |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Thu Sep 18, 2003 12:06 pm Post subject: |
|
|
Oh, Duhh.... I figured out what was wrong.
Your script uses an argument to know which npc to destroy (the 'who'), but the npc isn't passing to this script, because the texbox calls it *! So who is always 0 (or whatever the default is).
Instead, use this script:
Code: | script,enemyHpandatt1,who,begin
show textbox (100) #change this
wait for textbox
setvariable(enemyHP1,enemyHP1--1)
setvariable(herohp,herohp--1)
if(readglobal(5),<=,0)then(
destroyNPC(who)
wait(40)
writeglobal(1,readglobal(5)+5)
)
end
|
Then just link straight to the script from the npc, without showing any textboxs..
*Wait. Did you actually say that the textbox calls the script? :S _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
jabbercat Composer

Joined: 04 Sep 2003 Posts: 823 Location: Oxford
|
Posted: Thu Sep 18, 2003 10:02 pm Post subject: |
|
|
*American surfer voice* ahhhh DUDE! like totally raidcal!
*british voice*Pip Pip! thanks cacti ! the script is called from a text box but i've changed it somewhat here is the new script
code:
script,enemyHpandatt1,who,begin
resume npcs,writeglobal(enemyHP1--heroattack),setvariable(herohp,herohp--1),suspendNpcs
if(readglobal(5)<=0)then(destroyNPC(who),wait(4),writeglobal(5,5))
end
this means I can adapt the damage done by the hero using class and level!
ps.can you fix this script because Im dumb  _________________ 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 20, 2003 12:41 pm Post subject: |
|
|
Uhhh.... still not working?
ah ha...
writeglobal(enemyHP1--heroattack)
ain't right. Does this actually compile? That probably set global number enemyHP1 - heroattack to 0. You want
set variable(enemyHP1, enemyHP1--heroattack)
Here's you script rewritten: (don't clump it up like that)
Code: |
script,enemyHpandatt1,who,begin
set variable(enemyHP1, enemyHP1--heroattack)
setvariable(herohp,herohp--1)
if(readglobal(5)<=0)then(destroyNPC(who),wait(4),set variable(enemyHP1, 5))
end
|
You can take out the suspend and resume npcs commands, they do nothing. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
jabbercat Composer

Joined: 04 Sep 2003 Posts: 823 Location: Oxford
|
Posted: Mon Sep 22, 2003 9:48 pm Post subject: |
|
|
yay! Well now I've got the basics (yes that is basic) I can start doing advanced stuff like make spells and custom menus
any ideas on how to make a fire ball spell with a splash area?
I would want the spell to move in the defined direction and explode
here is whow I might be able to do it:
Code: |
Script,fireball,begin
#this is where the code to make the fire ball go in the direction you want:
#e.g if (keyispressed(left))then(blah,blah,blah) I have no idea about this
|
This is soo ruff but I have no idea _________________ Moogle no longer owes prizes. |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Tue Sep 23, 2003 8:32 am Post subject: |
|
|
Instead of checking all the arrow keys, just use the heros direction, and check for one shoot key. That's the easy bit. The hard bit is knowing when the fire bolt has crashed into an enemy... _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
jabbercat Composer

Joined: 04 Sep 2003 Posts: 823 Location: Oxford
|
Posted: Tue Sep 23, 2003 9:26 pm Post subject: |
|
|
how would I check the hero's directon _________________ Moogle no longer owes prizes. |
|
Back to top |
|
 |
Setu_Firestorm Music Composer

Joined: 26 Mar 2003 Posts: 2566 Location: Holiday. FL
|
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Wed Sep 24, 2003 5:05 am Post subject: |
|
|
More specifically (Before you go of and write seperate code for everydirection):
The global is so that you can only shoot one bolt at a time
Code: |
global variable (1, boltflying)
script, shootbolt, begin
variable (herodir, boltx, bolty, boltnpcref)
if (boltflying == false) then, begin
boltflying := true
herodir := hero direction(me)
#this block find the x and y co-ords of the tile in front of the hero.
if (herodir == up) then (boltx := hero x(me), bolty := hero y(me) -- 1)
if (herodir == right) then (boltx := hero x(me) + 1, bolty := hero y(me))
if (herodir == down) then (boltx := hero x(me), bolty := hero y(me) + 1)
if (herodir == left) then (boltx := hero x(me) -- 1, bolty := hero y(me))
boltnpcref := create npc (ID, boltx, bolty, herodir) #replace ID with the ID no. of the npc
walk npc (boltnpcref, herodir, 10) # change 10 to the distance the bolt will travel
#and then you need to do some checking to see whether the bolt has crashed into anything..
while (npc is walking(boltnpcref)) do, begin
boltx := npc x (boltnpcref)
bolty := npc y (boltnpcref)
if (npc at spot (boltx, bolty) <> boltnpcref) then, begin #this works on a presumtion that any other npc on the spot will have a lower npc reference, and therefore be returned
destroy npc (boltnpcref) #hopefully 'npciswalking' will return false if the npc doesn't exist
destroy npc (npc at spot (boltx, bolty)) #change this to take away enemy hp if you don't want it to kill him..
wait (1)
end
destroy npc (boltnpcref) #incase it stopped walking instead of hitting something
boltflying := false
end
end
|
Work on that... I hope it does work..
If you want a splash area, you'll have to add some code after the while loop.. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
jabbercat Composer

Joined: 04 Sep 2003 Posts: 823 Location: Oxford
|
Posted: Wed Sep 24, 2003 9:13 pm Post subject: |
|
|
Wow Thats umm well the less said *^_^* buuuut I think I get it , oh and by the way enemyHPandatt is broken again
Ps:congrats to lord Firestorm on hoshima! _________________ Moogle no longer owes prizes. |
|
Back to top |
|
 |
Setu_Firestorm Music Composer

Joined: 26 Mar 2003 Posts: 2566 Location: Holiday. FL
|
Posted: Wed Sep 24, 2003 10:23 pm Post subject: |
|
|
Umm...
*points to Mad Cacti*
What he said.
And..uh...I just started remaking Hoshima. How do you know it's not gonna suck?
I'm just kiddin' with ya. If I'm working on the story aspects, and Cube's workin' on the minigame aspects, then it'll be a crash-bang-boom of a game. _________________
Facebook: http://www.facebook.com/georgerpowell
Newgrounds: http://setu-firestorm.newgrounds.com |
|
Back to top |
|
 |
jabbercat Composer

Joined: 04 Sep 2003 Posts: 823 Location: Oxford
|
Posted: Sat Sep 27, 2003 1:05 pm Post subject: |
|
|
Is there any way an enemy can use it and hit you ?
exprence wont give me levels ,the global increases and every thing but why wont it give me levels!? _________________ Moogle no longer owes prizes. |
|
Back to top |
|
 |
Setu_Firestorm Music Composer

Joined: 26 Mar 2003 Posts: 2566 Location: Holiday. FL
|
|
Back to top |
|
 |
jabbercat Composer

Joined: 04 Sep 2003 Posts: 823 Location: Oxford
|
Posted: Sun Sep 28, 2003 1:48 am Post subject: |
|
|
come again ? _________________ Moogle no longer owes prizes. |
|
Back to top |
|
 |
Setu_Firestorm Music Composer

Joined: 26 Mar 2003 Posts: 2566 Location: Holiday. FL
|
Posted: Mon Sep 29, 2003 10:48 pm Post subject: |
|
|
jabbercat wrote: | Is there any way an enemy can use it and hit you ?
exprence wont give me levels ,the global increases and every thing but why wont it give me levels!? |
I was saying that as there are plotscripting commands that let you mess with various hero stats, there isn't a command to mess with your levels. _________________
Facebook: http://www.facebook.com/georgerpowell
Newgrounds: http://setu-firestorm.newgrounds.com |
|
Back to top |
|
 |
jabbercat Composer

Joined: 04 Sep 2003 Posts: 823 Location: Oxford
|
Posted: Mon Oct 13, 2003 10:43 am Post subject: |
|
|
all my levels work by global so that wont help
why me??? why must I have the crazy missions that will never work? _________________ Moogle no longer owes prizes. |
|
Back to top |
|
 |
|