Eclipse
January 05, 2009, 05:29:10 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Chat Help Rules Arcade Search Calendar Gallery Login Register  
 
 
 
Recent Topics +-
Free movies? by FS:CG Admin[Shadowwulf]
Today at 05:29:06 PM

Yes no Game by The Oracle
Today at 05:28:41 PM

what? by DrNova
Today at 05:28:06 PM

New sprites for Lostica?! by The MrMiguu™ [pizza pretzles]
Today at 05:27:14 PM

Lostica [Project Revamp] by The Oracle
Today at 05:26:41 PM

Open Book by The MrMiguu™ [pizza pretzles]
Today at 05:26:21 PM

stackable items? by bobo1172
Today at 05:24:38 PM

Key by bobo1172
Today at 05:24:01 PM

Rate the above user by The Oracle
Today at 05:19:06 PM

Disparity Recruiting by Peter
Today at 05:16:32 PM

Members Online +-
19 Guests, 34 Users
The Oracle,
FS:CG Admin[Shadowwulf],
Fingle,
Gwendalin,
nehako,
DrNova,
Pyridox,
Hikaru,
The MrMiguu™ [pizza pretzles],
Zuleloan,
tiggilyboo,
Darkniz,
dg1423,
•RЧĐIИØPHØR•,
Peter,
Stalfo,
bobo1172,
Electrokinesis,
Thelettersix,
>~(Squiddle)~<,
DragonFire,
Airscar,
Mitus,
Kreator,
Niko,
Leaf [zach],
Doomteam1,
Japez,
HawkStorm95,
Almighty Wing,
ʇıunpp ʎqɹıʞ࣭,
The Tribal,
Nospheratus,
timster0
Pages: [1] 2
  Print  
Author Topic: Boat Script  (Read 2753 times)
0 Members and 1 Guest are viewing this topic.
Marsh
Demi God

Offline Offline

Posts: 7,280


Comfort the disturbed. Disturb the comfortable.


View Profile WWW Email
User is on moderator watch listWatched
« on: August 10, 2005, 03:19:02 PM »

Difficulty: Medium 3/5

Creator: Dram

Code:

    Case 2
        If int(GetPlayerSprite(Index)) > 79 Then
           Call SetPlayerSprite(Index, 79)
           Call PlayerMsg(index, "You begin to set sail.", 2)
           Call SendPlayerData(index)

   ElseIf int(GetPlayerSprite(Index)) < 79 Then
             Call SetPlayerSprite(Index, 79)
           Call PlayerMsg(index, "You begin to set sail.", 2)
           Call SendPlayerData(index)
   End If

    Case 3  
   Dim Sprite

        Sprite = int(GetVar("accounts\" & GetPlayerLogin(index) &".ini", "CHAR" & GetPlayerCharNum(index), "Sprite"))
   
        If int(GetPlayerSprite(Index)) = 79 Then
               Call SetPlayerSprite(Index, Sprite)
               Call PlayerMsg(index, "You have docked.", 2)
               Call SendPlayerData(index)
        Else
               Call PlayerMsg(Index, "Step onto the water to begin sailing", 2)
        End If


Here you go people!

the boat script! Smile
turns you into a boat = Case 2
turns you Back = Case 3

Edit: oops did not know someone else posted it :blink:
Anonymous
Guest


Email
« Reply #1 on: January 22, 2006, 05:09:54 AM »

Im not good at scripting.
So i dont know where i should put the script
can u tell me?
marcopolo8
Member
**
Offline Offline

Posts: 31


View Profile WWW Email
« Reply #2 on: January 23, 2006, 04:41:42 AM »

I added call so i warp 2 blocks past on the the docking else the player can dock the boat carfully and then bring it upon land.


    Call PlayerWarp(index, 4, 5, 21)


of course each dock will need its own docking script - it did stop the problems with carefull planning.
dbgtrulz
Active Member
***
Offline Offline

Posts: 197


View Profile WWW Email
« Reply #3 on: January 23, 2006, 06:59:14 AM »

For case 2, why don't you just say:
Code: [Select]
If int(GetPlayerSprite(Index)) <> 79 Then
Call SetPlayerSprite(Index, 79)
Call PlayerMsg(index, "You begin to set sail.", 2)
Call SendPlayerData(index)
End If

The <> means "does not equal". So if the player's sprite does not equal 79 then turn him into a boat. Saves code and system resources :)
dbgtrulz
Active Member
***
Offline Offline

Posts: 197


View Profile WWW Email
« Reply #4 on: January 30, 2006, 02:31:59 PM »

I modified the boat script. The one you have up there as of this post has one big glitch: If you log out when you're a boat, or you save when your a boat, you will be a boat on last after docking, because it would've saved your sprite as 79. This version fixes that glitch:
Code: [Select]
Case 2
If int(GetPlayerSprite(index)) <> 79 Then
Call PutVar("accounts\" & GetPlayerLogin(index) &".ini", "CHAR" & GetPlayerCharNum(index), "noboat", GetPlayerSprite(index))
Call SetPlayerSprite(index, 79)
Call PlayerMsg(index, "You begin to set sail.", 2)
Call SendPlayerData(index)
End If
Case 3
Dim Sprite
Sprite = int(GetVar("accounts\" & GetPlayerLogin(index) &".ini", "CHAR" & GetPlayerCharNum(index), "noboat"))
If int(GetPlayerSprite(index)) = 79 Then
Call SetPlayerSprite(index, Sprite)
Call PlayerMsg(index, "You have docked.", 2)
Call SendPlayerData(index)
Else
Call PlayerMsg(index, "Step onto the water to begin sailing", 2)
End If
Baron
Lord Of Spleens
Administrator
Teh Uberleet
*
Offline Offline

Posts: 2,735


Genesis CoCreator - Eclipse Evo Developer


View Profile WWW Email
« Reply #5 on: January 30, 2006, 08:36:17 PM »

... Itd be easier if you just set up block tiles around all the water edges, and had one scripted tile that simply put a var into the character file.

ie (Psuedocode, not sadscript.)

Case scriptedtilenumberx

 if getVar boat <> 1 then
Putvar currentplayersprite into boattemp
set playersprite to boatsprite
Putvar boat = 1

 if getVar boat = 1 then
Set currentplayersprite to boattemp
Putvar boat = 0

-----

I couldnt be arsed scripting it completely properly. This script also relies on ini creation through On error Resume next.
Spike
Veteran
Advanced Eclipser
*
Offline Offline

Posts: 1,667



View Profile Email
« Reply #6 on: January 30, 2006, 11:50:39 PM »

id take barons word for it if i were u...hes one of the best scriptors i know
Baron
Lord Of Spleens
Administrator
Teh Uberleet
*
Offline Offline

Posts: 2,735


Genesis CoCreator - Eclipse Evo Developer


View Profile WWW Email
« Reply #7 on: January 31, 2006, 12:10:14 AM »

Quote from: ALANSPIKE
id take barons word for it if i were u...hes one of the best scriptors i know


Ill post my script for boats here in 2 secs, just debugging it...
Baron
Lord Of Spleens
Administrator
Teh Uberleet
*
Offline Offline

Posts: 2,735


Genesis CoCreator - Eclipse Evo Developer


View Profile WWW Email
« Reply #8 on: January 31, 2006, 01:04:44 AM »

Code: [Select]


Case SCRIPTEDTILEX
'DIM THESE:
'sprite
'onMsg
'offMsg

onMsg = PUT_GET_ON_MESSAGE_HERE
offmsg = PUT_GET_OFF_MESSAGE_HERE
sprite = PUT_SPRITE_NUMBER_HERE
Call Boatchange(index, sprite, onMsg, offMsg)



Thats your scripted tile code. Change SCRIPTEDTILEX to the new number.

Place this scripted tile wherever you want people to change from land to boat or vice versa.

Paste this at the bottom of your main.txt

Code: [Select]

'**************************
'**************************
'BOAT SCRIPT BY BARONY
'Last Edited Jan 31st 2006
'www.barony.deviantart.com
'**************************
'**************************

Sub Boatchange(index,sprite,onMsg,offMsg)
On Error Resume Next
Dim enterboat
Dim leaveboat
Dim boat

'***********


Boat = 0 + GetVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "boat")

If boat = 1 Then

leaveboat = 0 + GetVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "offboat")

Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "boat", "0")

Call Setplayersprite(index, leaveboat)
Call SendPlayerData(index)

Call PlayerMsg (index, OffMsg, 4)

End If

'****************

enterboat = 0 + (GetPlayerSprite(index))

Call PlayerMsg (index, "sprite = " & enterboat, 4)

If boat <> 1 Then

Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "boat", "1")

Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "offboat", 0 + enterboat )

Call Setplayersprite(index, sprite)
Call SendPlayerData(index)

Call PlayerMsg (index, onMsg, 4)

End If

End Sub

'**************************
'End Of Boat Script
'Place Scripted Tile calling this script where ever you want players to change from their current sprite to boat or vice versa.
'Do not delete the On Error Resume Next for this script, this is needed to create the .ini check logic.
'**************************



It is also important to note that this same script could be used to make players swim across rivers, drive cars etc etc.

Like all the scripts I write, I hope they are versatile enough toi help you do something cool. Enjoy this ;)
yakuza_II
Active Member
***
Offline Offline

Posts: 310


View Profile Email
« Reply #9 on: January 31, 2006, 05:29:17 AM »

thanx everyone i was usin a similar written script without realising its major flaw... phew.... take that bugs
Kay-No
Active Member
***
Offline Offline

Posts: 329



View Profile WWW Email
« Reply #10 on: February 02, 2006, 11:09:27 AM »

i using boat script and it works very good but theres one thing,
when i go on the boat scripted tile i turn into a boat but then can i
just go back and im a boat that sealing around on the land... :P

got one more question, can i make so  i need a item to go boating
like an boat contract?
Spike
Veteran
Advanced Eclipser
*
Offline Offline

Posts: 1,667



View Profile Email
« Reply #11 on: February 02, 2006, 11:45:54 AM »

o....k
Cruzn
Member
**
Offline Offline

Posts: 27


View Profile Email
« Reply #12 on: February 02, 2006, 01:17:16 PM »

Place at the bottom of the main.txt
Code: [Select]
' ********************************************
' * Base Script By: Dram // Script By: Cruzn *
' ********************************************
Sub BoatDock(index, sprite, message, color)
    If GetPlayerSprite(index) = sprite Then
        Call BlockPlayer(index)
        Call PlayerMsg(index, "Sorry, this is the entrance.", 1)
    Else
        Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "TempSprite" , 0)
        Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "TempSprite" , GetPlayerSprite(index))
        Call SetPlayerSprite(index, sprite)
        Call PlayerMsg(index, message, color)
        Call SendPlayerData(index)
    End If
End Sub

' ********************************************
' * Base Script By: Dram // Script By: Cruzn *
' ********************************************
Sub BoatExit(index, sprite, message, color)
    If GetPlayerSprite(index) <> sprite Then
        Call BlockPlayer(index)
        Call PlayerMsg(index, "Sorry, this is the exit.", 1)
    Else
    Call SetPlayerSprite(index, GetVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(Index), "TempSprite"))
    Call PlayerMsg(index, message, color)
    Call SendPlayerData(index)
    End If
End Sub


Use these codes under ScriptTile Sub::Examples;
Code: [Select]
   Case 2
        Call BoatDock(index, 31, "You set sail across the smooth seas.", 1)
    Case 3
        Call BoatExit(index, 31, "Your boat docks safely, and you walk off.", 1)

Code: [Select]
Call BoatDock(index, sprite, "message", color)

That should help... -- My version of this script.
yakuza_II
Active Member
***
Offline Offline

Posts: 310


View Profile Email
« Reply #13 on: February 02, 2006, 09:22:07 PM »

you need to have to docks one getting on the boat with scripted tile "1" and another with dock to get off boat with scripted tile "2"


wat happened to avatar baron !!!!!    its all pirated!!!! hehehe

pirates dig the booty :wink:
Spike
Veteran
Advanced Eclipser
*
Offline Offline

Posts: 1,667



View Profile Email
« Reply #14 on: February 03, 2006, 08:15:25 AM »

:lol:
Darkmage
Newb
*
Offline Offline

Posts: 20


View Profile Email
« Reply #15 on: February 15, 2006, 10:59:03 AM »

Where do i paste it and how do i get it to work?
IceCream Tuesday
Advanced Eclipser
*****
Offline Offline

Posts: 1,524


<3 you


View Profile Email
« Reply #16 on: February 15, 2006, 12:17:43 PM »

you paste it in your main txt
i suggest you dont use scripts untill you semi understand how the hell they work
thecobra
PROGRAMER for PSP and PC
Active Member
***
Offline Offline

Posts: 121



View Profile WWW Email
« Reply #17 on: August 01, 2007, 09:32:34 AM »

you need to have to docks one getting on the boat with scripted tile "1" and another with dock to get off boat with scripted tile "2"


wat happened to avatar baron !!!!!    its all pirated!!!! hehehe

pirates dig the booty :wink:

u can just mae a tile that check if u are a bouat or some one else
Spike
Veteran
Advanced Eclipser
*
Offline Offline

Posts: 1,667



View Profile Email
« Reply #18 on: August 01, 2007, 09:46:33 AM »

dude...this topic is 16 months old :O

please add a "BUMPED TOPIC" sign to the beginning of your post
bashh
Advanced
Member
**
Offline Offline

Posts: 83


Pixel Artist BASHH


View Profile Email
« Reply #19 on: July 30, 2008, 07:19:08 AM »

let me tell u something, if you turn into a boat and you have paperdoll, then your clothes will still be on. xD

So you'll look like a boat wearing clothes.
Pages: [1] 2
  Print  
 
 

Powered by EzPortal
Powered by MySQL Powered by PHP Powered by SMF 2.0 Beta 4 | SMF © 2006–2008, Simple Machines LLC | Sitemap Valid XHTML 1.0! Valid CSS!
Page created in 0.321 seconds with 33 queries.