 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
Serg

Joined: 17 Feb 2003 Posts: 28
|
Posted: Sun Aug 31, 2003 10:18 pm Post subject: npc that follows u |
|
|
im tryin to make a script that makes an npc follow u,look at avatar, right next to u like in the game metamorphosis i tried reading the script that comes with it but its nice and complicated just how moogle1 makes them,i also tried to copy a part of it but i couldnt make the npc follow hero 1,i also attempted makin my own script,changing it 5 times, but the npc was 2 tiles ex. (|N|T|H|),(n is npc-t is tile-h is hero) behind the hero and didnt follow like i intended it to, im tryin to make the npc appear behind the hero if he gose left and right ex.(|N|H|)-(|H|N|),above if he gose down
ex.(|N|)
(|H|),
and below if he gose up ex. (|H|)
(|N|)
,but not like in metamorphosis where if u push up and right at the same time the hero gose diagnal,and out of place like in between tiles,well if any1 can help me out thankz  |
|
Back to top |
|
 |
DemocraticAnarchist Sleep Deprived

Joined: 26 Apr 2003 Posts: 137 Location: :noitacoL
|
Posted: Wed Sep 03, 2003 12:40 am Post subject: Lets see |
|
|
I think this script will help, you were rambling a bit.
Code: |
include, plotscr.hsd
include, pstutor.hsi
define script (autonumber,npcplace,4,0)
define script (1,npcplace2,none) #use this to call the other script
script,npcplace,herox,heroy,direction,whichnpc,begin
if direction=left
(
set npc position (whichnpc,herox--1,heroy)
set npc direction (whichnpc,right)
)
else if direction=right
(
set npc position (whichnpc,herox+1,heroy)
set npc direction (whichnpc,left)
)
else if direction=up
(
set npc position (whichnpc,herox,heroy+1)
set npc direction (whichnpc,down)
)
else if direction=down
set npc position (whichnpc,herox,heroy--1)
set npc direction (whichnpc,up)
)
end
script, npcplace2,direction, begin
hero is walking (me) #substitute this for the hero you want
hero direction (me)=direction
npcplace (*,*,direction,*)
end
|
Substitute the *'s for the values herox, heroy and whichnpc respectively.
The script npcplace2 should be called on keypress
Hope i have helped, i havent been able to test the script, so im not sure if it works, but try it out.  |
|
Back to top |
|
 |
Serg

Joined: 17 Feb 2003 Posts: 28
|
Posted: Thu Sep 04, 2003 11:52 pm Post subject: not working |
|
|
yo i tried the script but it says this when i compile it:
Code: | define script (autonumber,npcplace,4,0)
expected argument default but define block ended |
|
|
Back to top |
|
 |
Setu_Firestorm Music Composer

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

Joined: 17 Feb 2003 Posts: 28
|
Posted: Fri Sep 05, 2003 7:51 am Post subject: |
|
|
so if i identify all 4 arguments wat numbers should i put, the heros x number,heros y number,the heros direction,and npcs number,or wat numbers should i put:idea: |
|
Back to top |
|
 |
Setu_Firestorm Music Composer

Joined: 26 Mar 2003 Posts: 2566 Location: Holiday. FL
|
Posted: Fri Sep 05, 2003 7:20 pm Post subject: |
|
|
That's where I'm lost. I don't normally use arguments. I just know that fact from plotscripting tutorials. That's something either Cube or James would know.
Or Blazes, but I haven't seen him around in a while. _________________
Facebook: http://www.facebook.com/georgerpowell
Newgrounds: http://setu-firestorm.newgrounds.com |
|
Back to top |
|
 |
Cube Dimensional Traveller

Joined: 02 Feb 2003 Posts: 294
|
Posted: Fri Sep 05, 2003 10:05 pm Post subject: |
|
|
define script (autonumber,npcplace,4,0)
should be:
define script (autonumber,npcplace,4,0,0,0,0)
The first number in the definition is just saying how many arguments you're going to have. The other 4 are the default values of them.
Also, in the script DemocraticAnarchist posted, the if statements are completely wrong. Firstly, the conditions in the if statements are missing brackets around them. (ex: if (direction==left) ). Also, as you can see in that example, there are TWO equal signs. One will do nothing. Next, after the condition a "then" is missing. Ex:
if (direction == left) then (
commands that do stuff
)
Finally, the OHRRPGCE does not support "else if" statements. You can only have one "then" and one "else" (Or none at all) per if statement. But because the direction can only be one or the other, just take out the else word and it should work fine. |
|
Back to top |
|
 |
Serg

Joined: 17 Feb 2003 Posts: 28
|
Posted: Sat Sep 06, 2003 12:52 am Post subject: more problems |
|
|
heres wat im trying to make the npc do,the hero gose in the vehicle which is 2 npcs long (ex: |npc3||hero1| ) a tag is checked,if on and the hero is walking left then the npc follows him left , if the hero turns right then the npc changes direction and is positioned behind the hero and then starts following the hero right, if the hero turns up then the npc changes direction and then follows the hero up,if he turns down the same thing, so this is the script changed, i hacked some stuff off from the other script,it compiles and makes the npc position behind the hero but when u walk around it makes the npc looks like if its being destroyed and created behind the hero, could some 1 help me so i can make the npc walk along with the hero smoothly,thankz a lot for the help
Code: | define script (autonumber,npcplace,1,3)
define script (5,npcplace2,none) #use this to call the other script
script,npcplace,whichnpc,begin
if(checktag(3)==on)then,begin
if (herodirection(me)==left)then,begin
set npc position (whichnpc,herox+1,heroy)
set npc direction (whichnpc,right))
else,begin
if (herodirection(me)==right)then,begin
set npc position (whichnpc,herox--1,heroy)
set npc direction (whichnpc,left))
else,begin
if (herodirection(me)==up) then,begin
set npc position (whichnpc,herox,heroy+1)
set npc direction (whichnpc,down))
else,begin
if (herodirection(me)==down)then,begin
set npc position (whichnpc,herox,heroy--1)
set npc direction (whichnpc,up))
end
end
end
end
end
script, npcplace2,begin
hero is walking (me) #substitute this for the hero you want
hero direction (me) #=direction
npcplace #(*,*,direction,*)
end
|
and some how it seems to work with out the # stuff that was in the other script |
|
Back to top |
|
 |
planethunter Lost In Emotion

Joined: 07 Jul 2003 Posts: 258 Location: Éire
|
Posted: Sat Sep 06, 2003 1:31 am Post subject: |
|
|
Forgive my curiousity but wouldn't that movement look 'blocky' when
changing direction, i.e. round corners and the like.
*Ph's advice* stick in a mid frame, think both sprites at a 45 degree angle. (which of course takes four 20x20 pictures up) but it would make it stand out from the rest. _________________ ~PH
 |
|
Back to top |
|
 |
planethunter Lost In Emotion

Joined: 07 Jul 2003 Posts: 258 Location: Éire
|
Posted: Sat Sep 06, 2003 3:16 am Post subject: |
|
|
I think somebody put a similar request out on the ohr message board at hamster republic. Check it out! _________________ ~PH
 |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Mon Mar 28, 2005 1:01 am Post subject: I am the one who has posted the message |
|
|
Hello! I am the one who has posted the message at the hamster republic message board. I am very interested by the script posted by Serg.
I tryed to use it but I don't understand well how to use it. Could somoene give me explanations and tell me to use this plostcript ?
1) What are the pre-requierement to make the script working ?
2) Shall the npc that is going to follow us run the plostcript or an invisible "step on" Npc ?
3) What is the check tag command for ? To make active or unactive the script that make the npc able to follow the hero (so that the hero is not always with a npc all the time) ?
4) So that I can do as less mistakes as possible could someone post a detailed guidelines with detailed step so that I can also use this script.
Thank you very much in advance for the help! |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Mon Mar 28, 2005 8:44 am Post subject: |
|
|
These scripts are messed up. If you're looking for a script to make NPCs follow you, you could use the default "follows you" movement type.
If that's not what you're looking for, I believe OHRRPGCE Tactics has a follow-script somewhere in the enemy movement AI. (It's on the gamelist and the scriptfile is included.) _________________
|
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Sat Apr 02, 2005 11:18 am Post subject: I managed to solve the problem by myself |
|
|
It's ok I managed to make a plotscript that makes follows the hero from a plotscript that had been posted here. I am going to post it on the FAQ website of the hamster republic: I am sure that many people are going to be interested by this! |
|
Back to top |
|
 |
chris98

Joined: 23 Feb 2005 Posts: 114 Location: On Jupiter, My rubber Boobie, s45 h79
|
Posted: Sat Apr 02, 2005 12:10 pm Post subject: |
|
|
This could be handy for a fan game of star ocean 3, playing as
(SPOILERS)
Flad, where the npc following you is Maria Traydor, keeping Flad in existence with the alteration gene. This would be required as Flad would not be a logged on player, He would still be a 4D being in a 3D world, he would use the terminal in Gemity to transport in and out of the Eternal Sphere. |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Thu Apr 14, 2005 6:27 am Post subject: For those who are interested feel free to use the script |
|
|
For the one who are interested to make their heroe followed an Npc by a hero, I post a script on the Faq wiki website of the hamster republic at
http://gilgamesh.dnsalias.org:8080/wiki/ohrrpgce/index.php/How_do_I_make_one%2C_two%2C_or_three_NPCs_follow_the_hero%3F
It's called How do I make one, two, or three heroes following you.
It's a efficient on key is pressed script that don't make the game low and that make believe the npc is an hero.
Thanks for positing the informations on that forum. Without them I couldn't have make my plotscript. |
|
Back to top |
|
 |
|
|
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
|