Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Need help with a script.

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Quinn




Joined: 30 Dec 2003
Posts: 46
Location: Castle Paradox

PostPosted: Fri Jan 09, 2004 3:16 am    Post subject: Need help with a script. Reply with quote

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. Sad...

Game Progress:
Emoticons-25% graphics(75%), story(50%)
Back to top
View user's profile Send private message Send e-mail
Flamer
The last guy on earth...




Joined: 04 Feb 2003
Posts: 725
Location: New Zealand (newly discovered)

PostPosted: Fri Jan 09, 2004 4:29 am    Post subject: Reply with 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.
_________________
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 Raspberry!
(no offense to anyone that was mentioned)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Iblis
Ghost Cat




Joined: 26 May 2003
Posts: 1233
Location: Your brain

PostPosted: Fri Jan 09, 2004 9:48 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Battleblaze
Warrior Thread Monk




Joined: 19 Dec 2003
Posts: 782
Location: IndY OHR

PostPosted: Fri Jan 09, 2004 9:52 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
Iblis
Ghost Cat




Joined: 26 May 2003
Posts: 1233
Location: Your brain

PostPosted: Fri Jan 09, 2004 3:51 pm    Post subject: Reply with quote

Why would it have to move up?
_________________
Locked
OHR Piano
Back to top
View user's profile Send private message Send e-mail
Me
HI.




Joined: 30 Mar 2003
Posts: 870
Location: MY CUSTOM TITLE CAME BACK

PostPosted: Fri Jan 09, 2004 5:32 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Quinn




Joined: 30 Dec 2003
Posts: 46
Location: Castle Paradox

PostPosted: Sat Jan 10, 2004 3:44 pm    Post subject: Reply with quote

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. Sad...

Game Progress:
Emoticons-25% graphics(75%), story(50%)
Back to top
View user's profile Send private message Send e-mail
Flamer
The last guy on earth...




Joined: 04 Feb 2003
Posts: 725
Location: New Zealand (newly discovered)

PostPosted: Sat Jan 10, 2004 7:18 pm    Post subject: Reply with quote

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 Raspberry!
(no offense to anyone that was mentioned)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Me
HI.




Joined: 30 Mar 2003
Posts: 870
Location: MY CUSTOM TITLE CAME BACK

PostPosted: Sat Jan 10, 2004 9:13 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Sat Jan 10, 2004 10:15 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Aethereal
SHUT UP.
Elite Designer
Elite Designer



Joined: 04 Jan 2003
Posts: 928
Location: Gone! I pop in on occasion though.

PostPosted: Sat Jan 10, 2004 10:37 pm    Post subject: Reply with quote

Shouldn't that be:

if (num >> 0) then (return (num)) else (return (num * -1)) ?
_________________
Back to top
View user's profile Send private message Send e-mail AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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