Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

A few questions


AdrianC
 Share

Recommended Posts

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

Awesome, thx. Its gona take me a while to do it this way, but it'll work.

EDIT

Ok, 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

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 Function

Then 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 Sub

Now 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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...