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

Vehicle Help

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
RedMaverickZero
Three pointed, red disaster!
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 12 Jul 2003
Posts: 1459

PostPosted: Wed Aug 11, 2004 2:24 pm    Post subject: Vehicle Help Reply with quote

include, plotscr.hsd #language definition

#---------------------------------------------------------

define script (1,Map Autorun,0)
define script (2,Remember where I parked,0)

#---------------------------------------------------------

global variable(1,used vehicle)
global variable(2,vehicle X)
global variable(3,vehicle Y)
global variable(4,used other vehicle)
global variable(5,other vehicle X)
global variable(6,other vehicle Y)

#---------------------------------------------------------

script,Map Autorun,begin
if (used vehicle)
then,begin
# replace the 0 with the NPC number of your vehicle
set NPC position(0,vehicle X,vehicle Y)
end
if (used other vehicle)
then,begin
# replace the 1 with the NPC number of your vehicle
set NPC position(1,other vehicle X,other vehicle Y)
end
end

#---------------------------------------------------------

script,Remember Where I parked,begin
# replace the 0 with the NPC number of your vehicle
set variable(vehicle X,NPC X(0))
set variable(vehicle Y,NPC Y(0))
set variable(used vehicle, true)
# replace the 1 with the NPC number of your vehicle
set variable(other vehicle X,NPC X(1))
set variable(other vehicle Y,NPC Y(1))
set variable(used other vehicle, true)
end


As you know, that's the script James "SPAM MAN" Paige wrote in Moogle1's tutorial. For the time being it has worked good. With one vehicle. Set as NPC (0). However, the time has come for my 2nd vehicle and... it isn't working. So there's Jame's scripts. Here are mine. If you can help me I would be very very appreciative. When I go to play the game and walk to NPC 1, I find that it isn't there. Then I tried and saw if NPC (0) and NPC (1) stored one another's X and Y as one. But they don't. Can someone please help me???

global variable (27,used vehicle)
global variable (28,vehicle X)
global variable (29,vehicle Y)
global variable (30,used other vehicle)
global variable (31,other vehicle X)
global variable (32,other vehicle Y)


script,Map Autorun,begin
if (used vehicle)
then,begin
set NPC position(0,vehicle X,vehicle Y)
end
if (used other vehicle)
then,begin
set NPC position(1,other vehicle X,other vehicle Y)
end
end

script,Remember Where I parked,begin
set variable(vehicle X,NPC X(0))
set variable(vehicle Y,NPC Y(0))
set variable(used vehicle, true)

set variable(other vehicle X,NPC X(1))
set variable(other vehicle Y,NPC Y(1))
set variable(used other vehicle, true)
end
_________________
---------------Projects----
Mr.Triangle's Maze: 70%
Takoyaki Surprise: 70%
Back to top
View user's profile Send private message Send e-mail AIM Address
Shadowiii
It's been real.




Joined: 14 Feb 2003
Posts: 2460

PostPosted: Wed Aug 11, 2004 2:43 pm    Post subject: Reply with quote

I can't tell you where the problem is, but I can tell you what I would do when scripting this.

First, change all the variable "true" ones, etc. into tags. Just take the variables out and use tags. You got like, what, 1000 of them and they are (in my opinion) WAY easier to work with. So...used vehicle and other used vehicle could be replaced with (set tag (x, on)) and for the if statements
if (checktag(x)) then (
set NPC position(0,vehicle X,vehicle Y)
)

Another thing, set NPC position moves the npc. The npc must be a perminent member of the map (that is, you can't use one you created with "make npc", etc.). This of course could be easily fixed (that is, if the npc was made and not a perminent map member) by using a "create npc (0, vehicle X, vechicle Y).

Also, for the sake of good coding, don't put spaces in variables (vehicle X --> vehicleX).

Another thing, I personally don't use the set variable command, because I think in math not in words. I'd use

vehiclex := npcx(0)
vehicley := npcy(0)


At any rate, thats how I'd do it. You can always try it that way (it's not much code difference) if you want.
_________________
But enough talk, have at you!
Back to top
View user's profile Send private message Send e-mail
RedMaverickZero
Three pointed, red disaster!
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 12 Jul 2003
Posts: 1459

PostPosted: Wed Aug 11, 2004 3:10 pm    Post subject: Reply with quote

Worthy fixed it. And it was somehow simple I suppose. Although I don't understand it. I needed to set the coordinates of "other vehicle". But it's all fixed. Thanks for anyone trying to help me.
_________________
---------------Projects----
Mr.Triangle's Maze: 70%
Takoyaki Surprise: 70%
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