garycornett39 Posted September 7, 2003 Share Posted September 7, 2003 I made a ship master that transports you to a Island and I want someone to greet you there as soon as you arrive by walking up to you but I get a error in the game when you teleport thereHeres my script short statefloat timer if ( menumode == 1) returnendif if ( GetDisabled == 1 ) returnendif if ( OnActivate -- 1 ) returnendif if ( state == -1 ) if ( GetDistance, Player < 150 ) set timer to + GetSecondsPassed if ( timer > 1 ) set timer to 0 endif endifendif if ( state == 0 ) DisablePlayerControls AITravel 153197.000, 291563.500, 64.260 set state to 10 elseif ( state == 10 ) if ( GetDistance, Player < 108 ) set state to 20 AiWander 0 0 0 90 0 0 0 0 0 0 0 0 endif elseif ( State == 20 ) EnablePlayerControls AITravel 154333.625, 291569.156, 65.106 endif can someone please help me out? Link to comment Share on other sites More sharing options...
garycornett39 Posted September 7, 2003 Author Share Posted September 7, 2003 ok figured it out but how would you add dialogue to it Link to comment Share on other sites More sharing options...
ThetaOrionis01 Posted September 7, 2003 Share Posted September 7, 2003 Give the NPc you want to greet the player a greeting in the dialogue editor Then add a few lines to your script First of all another variable so you don't get the greeting over and over again, eg short doonce add a condition somewhere like if ( doonce == 1 ) returnendif Then, in the bit of the script where you have the NPC walk up to the player, add something like if ( GetDistancePlayer < whatever distance you want the grreting to occur at ) NPC_ID -> Forcegreeting set doonce to 1 endif The NPC should then start talking to the player at the distance you specified. This should work...but my scripting is still very basic, so no guarantess that it will work. Link to comment Share on other sites More sharing options...
garycornett39 Posted September 7, 2003 Author Share Posted September 7, 2003 I get "script error:EXPESSION" after it runs though the script so far then it says "Right Eval" the my script looks like this now begin script short statefloat timershort doOnce if ( menumode == 1 ) returnendif if ( GetDisabled == 1 ) returnendif if ( OnActivate == 1 ) returnendif if ( state == -1 ) if ( GetDistance, Player <300 ) Set timer to + GetSecondsPassed if ( timer > 3 ) set timer to 0 endif endifendif if ( state == 0 ) DisablePlayerContols AiTravel ", ", " set state to 10 elseif ( state == 10 ) if ( GetDistance, Player <250 ) set state to 20 AiWander 0 0 0 90 0 0 0 0 0 0 0 0 endif if ( state == 20 ) if ( DoOnce == 0 ) if ( GreetOnce == 0 ) if ( GetDistance, Player <=10 ) NPC-> ForceGreeting set greetonce to 1 set doonce to -1 set state to 30 endif endif endif endif if ( state == 30 ) EnablePlayerControls AiTrval ", ", " endifendif End script Link to comment Share on other sites More sharing options...
ThetaOrionis01 Posted September 7, 2003 Share Posted September 7, 2003 Isn't right eval to do with declaring variables? Try addingShort GreetOnce Link to comment Share on other sites More sharing options...
garycornett39 Posted September 7, 2003 Author Share Posted September 7, 2003 errors are gone now but the force greeting dont work, thanks for the advice to Theta Orionis Link to comment Share on other sites More sharing options...
garycornett39 Posted September 7, 2003 Author Share Posted September 7, 2003 remodled my script a little. theres no errors but the force greeting still dont work, I tried to look it up in scripting for dummies but it didnt help much heres my new script Begin script short statefloat timershort doOnce if ( menumode == 1 )returnendif if ( GetDisabled == 1 )returnendif if ( OnActivate == 1 )returnendif if ( doOnce == 1 )returnendif if ( state == -1 )if ( GetDistance, Player <300 )set timer to + GetSecondsPassedif ( timer > 3 )set timer to 0endifendifendif if ( state == 0 ) DisablePlayerControlsAiTravel ", ", "set state to 10 if ( state == 10 )if ( doOnce == 0 )if ( GetDistance, Player <= 100 )ForceGreetingset doOnce 1set state 20endifendifendif if ( state == 20 ) EnablePlayerControlsAiTravel ", ", "endifendif End script If anyone can help I would appriciate it Link to comment Share on other sites More sharing options...
ThetaOrionis01 Posted September 7, 2003 Share Posted September 7, 2003 Sorry - tried to reply earlier but the forums broke again.... <_< Is the script attached to the NPC which gives you the forcegreeting? Else you have to specify who is to give the forcegreeting - or attach a simple forcegreeting script to the NPC Does the NPC have a greeting in the dialogue editor? I'd recommend putting the greeting into Greetings 5 where the quest related greetings seem to be, and making the greeting ID specific. Also, the distance you've specified for the forcegreeting is very small - I'd set it much larger. At distance 100 the NPC is almost stepping on the player's toes...Try setting the distance at 300 and see what happens. Good luck Link to comment Share on other sites More sharing options...
Bomo Posted September 7, 2003 Share Posted September 7, 2003 First of all. put some messagesboxes in to chek if your script cuts of somewhere. Second. the forcegreeting needs a id, page 38 scripting for dummies. Link to comment Share on other sites More sharing options...
garycornett39 Posted September 8, 2003 Author Share Posted September 8, 2003 thanks for the advice, I found out the distance wasnt as far as I wanted after 10 or so trys and I have the script attacted to the npc with the greeting and the greeting in greeting 1. I have everything working, only problem i have is after the force greeting I cant talk to that NPC again, and if I kill them I cant check there body ether. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.