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

A bit o help if you please

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




Joined: 19 Sep 2003
Posts: 19
Location: Deep in to the recesses of your mind.

PostPosted: Sun Oct 26, 2003 11:11 am    Post subject: A bit o help if you please Reply with quote

I've been trying to write a script that will walk an npc to a square next to your hero and then start a battle. The thing is I need this to work from five differant locations and I cannot figure out how to do this with scripts, short of writing five different ones. Can anyone help me?[/quote]
_________________
If you don't believe that God has a sense of humor then you explain the french!
Back to top
View user's profile Send private message
Uncommon
His legend will never die




Joined: 10 Mar 2003
Posts: 2503

PostPosted: Sun Oct 26, 2003 11:13 am    Post subject: Reply with quote

Yeah, I'll help.
"n" means that you need to replace it with the proper number value.

First, you need to define two global variables. We'll call them position x and position y. This happens in the declarations at the top, right after you define your scripts...

Code:
global variable (n,position x)
global variable (n,position y)


Then, you need a script that uses these to record the hero's position. This would go in the "eachstep script" space in the map properties. Don't forget to define this script.

Code:
script,position record,begin
set variable (poition x,hero x (0)) #recording the hero's x position into the position x global
set variable (position y,hero y (0)) #doing the same for y
end


Then just use it.

Code:
walk npc to x (n,position x--1) # it subracts one so that the npc ends up right next to the hero instead of on top of him.  If all goes well, it should end up one space to the left of the hero.
walk npc to y (n,position y)
wait for npc
fight formation (n)


Now, this off course assumes quite a bit about the map the npc is on, so it might need a little tweaking to take into consideration the obstructions between the npc and hero, which side of the hero the npc is on, etc, but hopefully you get the general idea.


Last edited by Uncommon on Sun Oct 26, 2003 11:31 am; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Mortem Monkey




Joined: 19 Sep 2003
Posts: 19
Location: Deep in to the recesses of your mind.

PostPosted: Sun Oct 26, 2003 11:28 am    Post subject: Reply with quote

Thanks! If this works I'll put your name down in the credits as Plotscripting consultant.
_________________
If you don't believe that God has a sense of humor then you explain the french!
Back to top
View user's profile Send private message
Uncommon
His legend will never die




Joined: 10 Mar 2003
Posts: 2503

PostPosted: Sun Oct 26, 2003 11:32 am    Post subject: Reply with quote

Shrug. Okay. Just remember what I said about how it might need a bit of tweaking depending on certain conditions.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Me
HI.




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

PostPosted: Sun Oct 26, 2003 11:57 am    Post subject: Reply with quote

A small pointer: You don't actually need the variables. Just use the herox(who) and heroy(who) functions, as they return the value that you want.
_________________
UP DOWN UP DOWN LEFT LEFT RIGHT RIGHT A B START
Back to top
View user's profile Send private message AIM Address
Uncommon
His legend will never die




Joined: 10 Mar 2003
Posts: 2503

PostPosted: Sun Oct 26, 2003 4:07 pm    Post subject: Reply with quote

Well, I suppose that's true, too.
Back to top
View user's profile Send private message Send e-mail Visit poster's website 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