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

no movement in order to run a script

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




Joined: 25 Mar 2003
Posts: 33

PostPosted: Wed Apr 02, 2003 9:20 am    Post subject: no movement in order to run a script Reply with quote

i need a way to make it so a script wont run if the character (during this part of the game your character is an npc) is moving...
the way it is setup...
your playing basketball and you press A to shoot but if you are moving it makes it so the ball wont dissapear so i need to make it so you have to stop and shoot inorder to shoot and also your character is an npc that you control (because your playing a game within a game). and i cant change the fact that the character is an npc
Back to top
View user's profile Send private message
Aethereal
SHUT UP.
Elite Designer
Elite Designer



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

PostPosted: Wed Apr 02, 2003 11:01 pm    Post subject: Reply with quote

if(npc is walking(mynpc)==false) then(do stuff).
_________________
Back to top
View user's profile Send private message Send e-mail AIM Address
Bob360
Rusty Vet




Joined: 25 Mar 2003
Posts: 33

PostPosted: Thu Apr 03, 2003 9:30 am    Post subject: Reply with quote

damn it!!! that wont work because my script is based off of what i learned from looking at james side scroll(sets the characters pixel) ... any other suggestions (JAMES HELP ME)
Back to top
View user's profile Send private message
Cube
Dimensional Traveller




Joined: 02 Feb 2003
Posts: 294

PostPosted: Thu Apr 03, 2003 6:33 pm    Post subject: Reply with quote

That ought to work though. Although I'm quite sure you're using heroes and not NPCs to move the character around, right?

It's basically what Aeth typed, but a little differently.

if (hero is walking (me) == false) then (do stuff)

That ought to work.
Back to top
View user's profile Send private message
Blazes Battles Inc.
I'm a chimp, not a




Joined: 25 Jan 2003
Posts: 505

PostPosted: Thu Apr 03, 2003 8:20 pm    Post subject: Reply with quote

For pixel moving, just see if they are holding down the move button.

if (key is pressed (thekeytheypresstomove)) then () else()
_________________
Preserve OHR history! Do it for the children!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Guest







PostPosted: Fri Apr 04, 2003 9:19 pm    Post subject: Reply with quote

Thank's ill try these and get back to you
Back to top
Bob360
Rusty Vet




Joined: 25 Mar 2003
Posts: 33

PostPosted: Fri Apr 11, 2003 7:41 am    Post subject: Reply with quote

Its still wont WORK!!!! ARRRRRRGGGGG!!!! the problem is that the npc moves is still moving when the key is nolonger pressed...
Back to top
View user's profile Send private message
Gizmog1
Don't Lurk In The Bushes!




Joined: 05 Mar 2003
Posts: 2257
Location: Lurking In The Bushes!

PostPosted: Sat Apr 12, 2003 7:04 am    Post subject: Reply with quote

I think I know what's happening. The npc keeps moving, because he's been told to, probably. Like, let's say, I hold the left key down for 5 seconds. Everytime the script runs through blah, blah blah blah if keysipressed, blah blah blah wait (1) it tells that npc to walk one more space left. But, it's going to add up, so if it's been told 5 times, and only walked 3 spaces, it'll keep on going. You need to add a wait for npc somewhere, to keep the script from starting to check again, before he's stopped moving. And that should do it.
Back to top
View user's profile Send private message Send e-mail AIM Address
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Fri Apr 18, 2003 6:57 pm    Post subject: knowing if an NPC is moving using side-scroll.hss Reply with quote

In a normal game, you can use the "hero is walking ()" and "NPC is walking()" plotscripting commands to know if a hero or NPC is already moving. However, if you are basing your plotscript on side-scroll.hss , then the normal movement has been overriden, and those commands will not help you.

Look in side-scroll.hss where it says:

define constant(100,Xv) # vars 100 to 399 are X velocity
define constant(400,Yv) # vars 400 to 699 are Y velocity


Xv and Yv are used for a "fake array" that holds the X and Y velocity of each NPC on the side-scrolling map. If the NPC's X velocity is 0 then that means it is not moving left or right. If an NPC's Y velocity is zero, that means it is not jumping or falling right now.

The tricky part is knoeing how to read and write the values in this "fake array". lets look at the code in side-scroll.hss for walking left and right:

#walking
if (want left, xor, want right) then(
if (want left) then(
# normal walking
write global(xv+player,read global(xv+player)--3)
if (read global(xv+player) <= -6) then(write global(xv+player,-6))
)
if (want right) then(
# normal walking
write global(xv+player,read global(xv+player)+3)
if (read global(xv+player) >= 6) then(write global(xv+player,6))
)
)


to set a value in a fake array, you say:
write global(first ID + this ID, value)


and to read a value from a fake array, you say:
read global(first ID + this ID)


But that is too confusing. That is too much like programming. Let me give you what you REALLY want, which is a nice easy way to know if an NPC in your side-scroller is moving or not.


define script(autonumber,SSNPC is moving,1,0)

script, SSNPC is moving, who, begin
if(read global(Xv+who)==0,and,read global(Yv+who)==0)
then(return(false))
else(return(true))
end


Just add that to your script, and use "SSNPC is moving()" in an "if" to know whether or not the NPC you are working with is moving.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Fri Apr 18, 2003 6:59 pm    Post subject: Reply with quote

Wow. <pre> tags come out really ugly on this board. I should have used bbcode.

Code:

define script(autonumber,SSNPC is moving,1,0)

script, SSNPC is moving, who, begin
  if(read global(Xv+who)==0,and,read global(Yv+who)==0)
    then(return(false))
    else(return(true))
end
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Bob360
Rusty Vet




Joined: 25 Mar 2003
Posts: 33

PostPosted: Tue Apr 22, 2003 3:20 am    Post subject: Reply with quote

Thank you James...
This thing has been irratating me for SOOOOOOOOOOOOOOOO LOOOOOOOOOONNNNNNNNNNNNGGGGGGG!!!!....
This makes it look and run alot more smoother... :>
Back to top
View user's profile Send private message
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