View previous topic :: View next topic |
Author |
Message |
Quinn

Joined: 30 Dec 2003 Posts: 46 Location: Castle Paradox
|
Posted: Fri Jan 09, 2004 3:16 am Post subject: Need help with a script. |
|
|
I am working on a fake battle script. What I need to do is show the battle backdrop as a map then have and NPC move back and fourth horizontally across the page at a fast speed until the player presses enter, after they do that the NPC must stop where it is and based on its position (the closer to the middle the better), give a stat bonus or decrease to the player and then start the battle. I've done most of it, all I need is how to get the NPCs position and based on that change the players stats so could someone please help me. _________________ Im on 99% game making and 1% schoolwork so that kleaves no time to post.
Game Progress:
Emoticons-25% graphics(75%), story(50%) |
|
Back to top |
|
 |
Flamer The last guy on earth...

Joined: 04 Feb 2003 Posts: 725 Location: New Zealand (newly discovered)
|
Posted: Fri Jan 09, 2004 4:29 am Post subject: |
|
|
...i'd help... if i knew what you were asking... i mean, there's punctuation and all, but every idea is linked to another and just have clear indication on what you want help on. _________________ 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 |
|
 |
Iblis Ghost Cat

Joined: 26 May 2003 Posts: 1233 Location: Your brain
|
Posted: Fri Jan 09, 2004 9:48 am Post subject: |
|
|
Quote: | ...i'd help... if i knew what you were asking... i mean, there's punctuation and all, but every idea is linked to another and just have clear indication on what you want help on. |
I didn't see anything confusing about it. He clearly stated what he needed:
Quote: | all I need is how to get the NPCs position and based on that change the players stats so could someone please help me. |
I'm guessing this is something similar to the slot machine in the FF7 battle arena. _________________ Locked
OHR Piano |
|
Back to top |
|
 |
Battleblaze Warrior Thread Monk

Joined: 19 Dec 2003 Posts: 782 Location: IndY OHR
|
Posted: Fri Jan 09, 2004 9:52 am Post subject: |
|
|
So it's like A timing thing... You could make an on keypress script where the NPC stops and moves up one. And where ever it moves up it will activate a special plotscript that increases/decreases the stat. _________________ Indy OHR! and National OHR Month Contest going on now!
"Aeth calls PHC an anti-semite; PHC blames anti-semitism"
-squall |
|
Back to top |
|
 |
Iblis Ghost Cat

Joined: 26 May 2003 Posts: 1233 Location: Your brain
|
Posted: Fri Jan 09, 2004 3:51 pm Post subject: |
|
|
Why would it have to move up? _________________ Locked
OHR Piano |
|
Back to top |
|
 |
Me HI.

Joined: 30 Mar 2003 Posts: 870 Location: MY CUSTOM TITLE CAME BACK
|
Posted: Fri Jan 09, 2004 5:32 pm Post subject: |
|
|
Okay, what I would do here would be have the NPC set to . . . about face, is it? The walking mode where they only turn around, whatever that's called. The map would have an on-keypress script that, when run, would switch the NPC's mode to "stand still" (command: alter NPC(who, npcstat:movetype,npcmovetype:standstill)). Then I would check the NPC's position using NPCx(who) (if the NPC is moving right-left) or NPCy(who) (if the NPC is moving up-down), and compare that number to the coordinate of the center point. The smaller the difference between the two, the larger the stat increase. Change the stat with set hero stat(who, stat, type). _________________ UP DOWN UP DOWN LEFT LEFT RIGHT RIGHT A B START |
|
Back to top |
|
 |
Quinn

Joined: 30 Dec 2003 Posts: 46 Location: Castle Paradox
|
Posted: Sat Jan 10, 2004 3:44 pm Post subject: |
|
|
This has helped but if I increase a stat how do I decrease the stat back to its original after the battle? _________________ Im on 99% game making and 1% schoolwork so that kleaves no time to post.
Game Progress:
Emoticons-25% graphics(75%), story(50%) |
|
Back to top |
|
 |
Flamer The last guy on earth...

Joined: 04 Feb 2003 Posts: 725 Location: New Zealand (newly discovered)
|
Posted: Sat Jan 10, 2004 7:18 pm Post subject: |
|
|
that's easily done, after reading what is wanted to be done...
use the center co-ordinate (x for horizontal and y for vertical, not both)
then minus it from the npc's co-ordinates and it'll have a negative value. _________________ 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 |
|
 |
Me HI.

Joined: 30 Mar 2003 Posts: 870 Location: MY CUSTOM TITLE CAME BACK
|
Posted: Sat Jan 10, 2004 9:13 pm Post subject: |
|
|
Or store the original stat in a global variable (or perhaps a local, depending on the situation), and just set the stat back to that after the battle. _________________ UP DOWN UP DOWN LEFT LEFT RIGHT RIGHT A B START |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sat Jan 10, 2004 10:15 pm Post subject: |
|
|
yes. And to calculate to increase/decrease to stats, use this formula:
stat change := abs (npc pixel x -- 160) * -1 + constant
at 'constant' pixels away from the center, theres no change. closer and theres an increase, further a decrease. Might want to square that whole expression for added effect.
(use the abs (absolute) function from FureWulffs 3rd party PS library, or code your own:
script, abs, num, begin
if (num >> 0) then (return (num * -1)) else (return (num))
end
) _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Aethereal SHUT UP. Elite Designer


Joined: 04 Jan 2003 Posts: 928 Location: Gone! I pop in on occasion though.
|
Posted: Sat Jan 10, 2004 10:37 pm Post subject: |
|
|
Shouldn't that be:
if (num >> 0) then (return (num)) else (return (num * -1)) ? _________________
 |
|
Back to top |
|
 |
|