AdrianC Posted September 11, 2008 Author Share Posted September 11, 2008 Hey, I need some help.I can't seem to figure out how to make a script delay. I want to click on a title, than there's like a 2 second delay, and than the rest of the script executes.Also, I don't want the player (or any npcs) to be able to walk on top of the scripted title. The problem is you can't set the title to have an On Click attribute, and a block attribute at the same time.Thanks for the help Link to comment Share on other sites More sharing options...
AdrianC Posted September 13, 2008 Author Share Posted September 13, 2008 Anybody? Link to comment Share on other sites More sharing options...
Bobosk Posted September 13, 2008 Share Posted September 13, 2008 you can use timers, with a 1000 ms delay between each run, and have it put a var in a randomly named .ini and check the var each time the timer runs itself Link to comment Share on other sites More sharing options...
AdrianC Posted September 14, 2008 Author Share Posted September 14, 2008 Hmm ok, thxHow about my other question?How do you place an On Click location, on which you can't walk? Link to comment Share on other sites More sharing options...
monowolf00 Posted September 14, 2008 Share Posted September 14, 2008 Place a block attribute IN the script. Link to comment Share on other sites More sharing options...
AdrianC Posted September 14, 2008 Author Share Posted September 14, 2008 That's what I though…But what's the command for a block attribute. I can't find it in the All Commands thread... Link to comment Share on other sites More sharing options...
monowolf00 Posted September 14, 2008 Share Posted September 14, 2008 Look at the bottom of your main.txt for the list of attribute commands. Link to comment Share on other sites More sharing options...
AdrianC Posted September 14, 2008 Author Share Posted September 14, 2008 Awesome, thx. Its gona take me a while to do it this way, but it'll work.EDITOk, problem.If I use those, than the title atribute will be changed to block, and then when you click on that title, nothing happens…The player mustn't be able to walk on these titles, but when they click on them, something should happen. Link to comment Share on other sites More sharing options...
DrNova Posted September 15, 2008 Share Posted September 15, 2008 Here you go. Credit to Baron for these scripts.First you MUST have this function added for the block player function to work.If it isnt in your main by default, add it> Function GetPlayerDirX(index)> If GetPlayerDir(index) = 0 Then> GetPlayerDirX = GetPlayerX(index)> ElseIf GetPlayerDir(index) = 1 Then> GetPlayerDirX = GetPlayerX(index)> ElseIf GetPlayerDir(index) = 2 Then> GetPlayerDirX = GetPlayerX(index) - 1> ElseIf GetPlayerDir(index) = 3 Then> GetPlayerDirX = GetPlayerX(index) + 1> End If> End Function> > 'Returns the Y of the tile in front of the player> Function GetPlayerDirY(index)> If GetPlayerDir(index) = 0 Then> GetPlayerDirY = GetPlayerY(index) - 1> ElseIf GetPlayerDir(index) = 1 Then> GetPlayerDirY = GetPlayerY(index) + 1> ElseIf GetPlayerDir(index) = 2 Then> GetPlayerDirY = GetPlayerY(index)> ElseIf GetPlayerDir(index) = 3 Then> GetPlayerDirY = GetPlayerY(index)> End If> End FunctionThen add this function, the blockplayer function.> Sub blockplayer(index) > > Dim direction> > direction = GetPlayerDir(index)> Select Case Int(direction)> Case 0> Call PlayerWarp(index, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index)+1)> Case 1> Call PlayerWarp(index, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index)-1)> Case 2> Call PlayerWarp(index, GetPlayerMap(index), GetPlayerX(index)+1, GetPlayerY(index))> Case 3> Call PlayerWarp(index, GetPlayerMap(index), GetPlayerX(index)-1, GetPlayerY(index))> End Select> End SubNow just add> call blockplayer(index)in your scripted tiles to add a block to it.So you can have scripted tiles that run a script but also have a block in them.HOWEVER, this wont work on clickable tiles, since the scripts in a clickable tile only activate when you click the tile, not when the player walks on it.But its extremely usefull nevertheless. Link to comment Share on other sites More sharing options...
AdrianC Posted September 15, 2008 Author Share Posted September 15, 2008 Nice script, however since its not working with clickable titles it doesn't help me that much.I'm making my own skill system, and I find that walking back and forth on top of a tree or whatever is weird. So I made a script that checks to see if you're near the resource you're trying to mine/woodcut/etc., and if you're close to it than, when you click the on click title, you start mining.The problem is you can now walk on top of the On Click titles, and it looks weird. Link to comment Share on other sites More sharing options...
Marsh Posted September 15, 2008 Share Posted September 15, 2008 I always just used warps so you can keep walking in one direction.Or have it triggered when attacking. Link to comment Share on other sites More sharing options...
AdrianC Posted September 16, 2008 Author Share Posted September 16, 2008 K, thx marsh, I guess I'll change the script so that the player mines when attacking. 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