The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Re-deed ship
Author Message
tleilax
Journeyman
*

Posts: 56
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jun 2012
Reputation: 0



Post: #1
Re-deed ship
Hello,

is there a way to re-deed a ship? Or do I have to script it completely? Also, I wonder what would happen to items that are stored in that "chest" there.

I've tried searching, but found nothing.
01-18-2014 09:39 PM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #2
RE: Re-deed ship
Just like for houses, the redeed is up to script. You can add a simple dialog to t_ship or t_tillerman in its @DClick and create a i_deed setting its more to <baseid>
01-18-2014 11:52 PM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #3
RE: Re-deed ship
Code:
[PLEVEL 1]
drydock

[function drydock]
SYSMESSAGE Target the tiller
targetf dock

[function dock]
IF (<src.uid>==<argo.more1> || <src.isgm>==1)
    ref1 <argo.more1>
    serv.newitem i_deed_<STRSUB 8 50 <ref1.baseid>>
    new.bounce
    ref1.remove
    return 1
ELSE
    SYSMESSAGE Only the captain can dock this ship
    return 1
ENDIF

Items in the hold would be lost as the ship is essentially destroyed.
Tiny as this is, I have put it up in my section for easy finding

[Image: 2nis46r.jpg]
(This post was last modified: 01-19-2014 12:16 AM by Mordaunt.)
01-19-2014 12:00 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #4
RE: Re-deed ship
Of course it works....
I didn't add a check for the item (foolishly) but you target the tiller with it, not the ship mast which may be where you went wrong.
Also don't use obj

[Image: 2nis46r.jpg]
(This post was last modified: 01-19-2014 12:19 AM by Mordaunt.)
01-19-2014 12:18 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #5
RE: Re-deed ship
huh.. missed a line when i did it, and yet oddly it was still working, should read:

Code:
[PLEVEL 1]
drydock

[function drydock]
SYSMESSAGE Target the tiller
targetf dock

[function dock]
ref1 <argo.more1>
IF (<argo.type>==t_ship_tiller)
    IF (<src.uid>==<ref1.more1> || <src.isgm>)
        serv.newitem i_deed_<STRSUB 8 50 <ref1.baseid>>
        new.bounce
        ref1.remove
        return 1
    ELSE
        SYSMESSAGE Only the captain can dock this ship
        return 1
    ENDIF
ELSE
    SYSMESSAGE That's not a ship's tiller.
ENDIF

[Image: 2nis46r.jpg]
01-19-2014 12:40 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #6
RE: Re-deed ship
You should never use OBJ unless needed, as its global and may get overwrited with another script, refx are like locals, created and destroyed in this code section.

BTW, just link from that function to the chest and place all the items inside a backpack and move it to player's bank, should be easy.
01-19-2014 12:41 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #7
RE: Re-deed ship
You're gonna make me go and make this bigger aren't you, sonofa.....

Later I'll do it later, got some stuff to do

[Image: 2nis46r.jpg]
01-19-2014 12:48 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
tleilax
Journeyman
*

Posts: 56
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jun 2012
Reputation: 0



Post: #8
RE: Re-deed ship
If I try .xshow more1 on the tiller man, it shows UID of the ship. Maybe my ship script is old then?

Also, added some function to delete unused keys from backpack:
Code:
forcont <findlayer.layer_pack.uid> 0
  if ((<type>==t_key) && (<more1>==<obj.uid>))
    remove
  endif
endfor

Is that a proper way to do that?
(This post was last modified: 01-19-2014 01:37 AM by tleilax.)
01-19-2014 12:52 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #9
RE: Re-deed ship
Yeah like this, spent 5 mins and added to it (hopefully Xun won't come up with any more ideas)

Redeeds, bounces "ship's hold" contents to your bank and removes all related ship keys:

Drydock (Ship Redeeding)

[Image: 2nis46r.jpg]
01-19-2014 03:50 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #10
RE: Re-deed ship
Oh, at your wishes Smile. Is there a way the key can be duplicated? if so it would work better using forinstances in key and removing the ones linked with this ship, it would be great also if you add a small dialog similar to the one for your houses, also a limit of ships per account and some kind of taxes.
01-19-2014 04:01 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 3 Guest(s)