Jump to content

Starting of Stage Plugin


Recommended Posts

Hey everyone,

I'm trying to create plugin for staging and for some reason, I can't find any documentation about the icon selection.

I found the one for deselecting a stage though.

I'm trying to also figure out if this should be under the monobehavior or if it part of the parts part.

any help would be greatly appreciated.

thank you.

Link to comment
Share on other sites

Staging behaviour of a part or group of parts is a part module.

Behaviour of the staging list in general (eg. creating a new UI) would be a KSP Addon/MonoBehaviour

Basically, does the behaviour belong to the part (part module), vessel (vessel module), or scene/game (KSP Addon/Monobehaviour)

All parts have a stagingIcon field (I would guess it overrides a set of defaults picked out by the part modules a part has) for specifying it, and you can get (and probably set) a parts staging icon in code via Part.stagingIcon

Edited by Crzyrndm
Link to comment
Share on other sites

I've messed around with this myself and never really got anywhere either.

The one tip I can give you is that the icon texture can be changed via:

Part.stageIcon.SetIcon(Part,string,int,int);

Part is the part you are changing the icon on, string is the texture location in the GameDatabase, int and int are the coordinates to start. Unlike other textures in the game which scale, .SetIcon picks out a set number of pixels. (I can't remember the number, I'll use 20 pixels big in this post.)

So if your texture you load with string is 40 pixels by 40 pixels, you have 4 different staging icons at pixel location 0,0 0,20 20,0 and 20,20

I didn't get much beyond that though, so good luck with your work.

D.

Link to comment
Share on other sites

Ok, that makes a lot more sense, Thank you.

I haven't had a chance to mess around with this since I posted, but am looking into it today.

I was wondering if I should use Modular Manager because I'm not adding any parts, I am actually just making it where I can do certain things in game with the staging area.

I am completely new to making game plugins and I've gone through a few tutorials, but couldn't find anything in depth like what I am trying to do, which probably means there isn't a plugin out there like this which is a good thing because I don't want to reinvent the wheel if you know what I mean.

Anyhow, I'll look into playing around with the things you mentioned.

thanks again.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...