Drakiac Posted March 16, 2011 Author Share Posted March 16, 2011 I have some questions on how to do a few source edits. I have edited the source for scripted tiles and scripted NPC's using Richy's tutorial.1) I want it so that when a player steps on a scripted tile that it will set that player's variable, let's just say stepv, to 1\. I only want this variable to affect the player, not anyone else. What's the line for this?2) When a player warps into a room I want this to set off something in the room, such as message saying "Welcome to my room!" Where and How would I edit the source to achieve this?3) When I have a scripted NPC talking to a player, how can I make it so that the player has to click a key, preferably enter, to hear the next line?Thanks-Drakiac Link to comment Share on other sites More sharing options...
The New World Posted March 16, 2011 Share Posted March 16, 2011 1\. MyIndex.2\. In the warp attribute's actions, server side.3\. Check if the player is in conversation when they press enter, and if they are then go to the next part of the conversation, else exit the action. Link to comment Share on other sites More sharing options...
Drakiac Posted March 16, 2011 Author Share Posted March 16, 2011 For 1) how would I write it?I though it might be something like GetPlayerName.stepv = 1 How do I actually write it? Link to comment Share on other sites More sharing options...
iSKweek Posted March 16, 2011 Share Posted March 16, 2011 Player(index/myindex).Name/sprite/level etc :) Link to comment Share on other sites More sharing options...
Drakiac Posted March 16, 2011 Author Share Posted March 16, 2011 Thanks Skweek! So, an I replace .name with a variableExample: Player(index).stepv = 1Is that the correct way to write it?Edit: I tried that and it didn't recognize .stepv even after I did Dim stepv.Also, how do I dim a variable once so that it never dims again? Where can I put it in the source? Link to comment Share on other sites More sharing options...
iSKweek Posted March 16, 2011 Share Posted March 16, 2011 If it is something you want to be permanently stored in the player file you need to add it to playerrec in modTypes. Link to comment Share on other sites More sharing options...
Drakiac Posted March 16, 2011 Author Share Posted March 16, 2011 Ok thanks!Edit:This is what I put in Playerwarp (I changed variable to Stepdd):``` If Player.Stepdd <> 1 Then If GetPlayerMap(index) = 4 Then Call PlayerMsg(index, "Welcome!", White) Stepdd = 1 Else End If Else Call PlayerMsg(index, "You have already been here...", White) End If```In the modTypes under Private Type PlayerRec I put:```Stepdd As Byte```When I try to compile it highlights the Player in Player.Stepdd and says Compile error: Invalid Qualifier. What am I doing wrong?Edit 2:I fixed it!```If GetPlayerMap(index) = 4 Then If Player(index).Stepdd <> 1 Then Call PlayerMsg(index, "Welcome!", White) Player(index).Stepdd = 1 Else Call PlayerMsg(index, "You have already been here...", White) End If Else End If```Thank you guys so much!-Drakiac Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now