Otaku World Forums Forum Index Otaku World Forums
A Place to discuss the contents of Otaku World
at http://otakuworld.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

If-Endif help with closet options

 
Post new topic   Reply to topic    Otaku World Forums Forum Index -> FKiSS Coding
View previous topic :: View next topic  
Author Message
Shin_Kai
Otaku Ultima


Joined: 03 May 2002
Posts: 1683
Location: LOTR land

PostPosted: Sat Oct 25, 2008 8:14 pm    Post subject: If-Endif help with closet options Reply with quote

Hi. I would like some help. I have always had trouble with the code for this. Explanation: I have several menu options labelled "skirts.cel" etc and would like for them to map only the clothing option chosen. So if a player clicked on skirts they would get all the skirts mapped.

I am using FKiss4 already but every time I have tried this code before, the clothes pop up in other sets.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
jeffco
Mega Mega Otaku


Joined: 12 Oct 2003
Posts: 685
Location: indiana, usa

PostPosted: Thu Nov 13, 2008 10:29 am    Post subject: Reply with quote

i'm not sure if you got this figured out or not.

of course i'm sure you have them mapping either by a label() with all the mapping or just a map(!skirts) with a cel group. and i'm sure you've got all the clothes not on the body unmapping with something like this:

Code:
;@label(6)
;@   letinside(I,#2,#1)
;@     ifnotequal(I,1)
;@     unmap(#2)
;@     endif()
;@   letinside(I,#3,#1)
;@      ifnotequal(I,1)
;@     unmap(#3)
;@     endif()
etc....


the easy fix for this is the set() command. so make something like this for each set:

Code:
;@set(1)
;@  map(!skirts)
;@  map(!dresses)
;@  map(!tops)
;@  map(!shoes)
;@  label(6)


you'll have to have all the appropriate menu stuffs mapped or unmapped too. [i find it easier to have the menu close each time you switch sets.] but that'll make it, so that only the sutff on the body are mapped every time you switch sets. a little note: put the same code under the begin() command as well, as set(0) will not activate until you switch back to it from another set.

i hope that answers your question.
Back to top
View user's profile Send private message Visit poster's website
Ruthless
Otaku Ultima


Joined: 27 Apr 2002
Posts: 2824

PostPosted: Thu Nov 13, 2008 3:30 pm    Post subject: Reply with quote

You can also use it this way

;@ letinside(I,#2,#1) ifequal(I,0) unmap(#2) endif() (saves you from typing "not" a million times)

If you prefer more precise collision detection, you can use letcollide, which detects collisions by pixel contact rather than object bounding box contact. This may be necessary if your doll has a pose that creates a very large bounding box eg outstretched arms or kicking legs or a doll with long hairy spikes in every direction etc, which will result in clothing that are fairly remote from the doll's body snapping to it unintentionally.

;@ letcollide(I,"skirt1.cel","base.cel") ifequal(I,0) unmap(#2) endif()

Quote:
a little note: put the same code under the begin() command as well, as set(0) will not activate until you switch back to it from another set.


Except it might be better to put it under initialize() rather than begin()

I think it has to do with whether the viewer displays the doll before it finishes loading the code (begin) or doesn't display the doll until all the code is loaded (initialize). Initialize() is is the first command that precedes all fkiss commands, and its role is to tell the viewer where the cel listing ends and where the program code begins. Begin actually occurs after initialization, so there will be few seconds where you actually see all the jumbled cels before the begin command commences and starts unmapping cels in the way you want it displayed.
Back to top
View user's profile Send private message Send e-mail
jeffco
Mega Mega Otaku


Joined: 12 Oct 2003
Posts: 685
Location: indiana, usa

PostPosted: Thu Nov 13, 2008 6:17 pm    Post subject: Reply with quote

Ruthless wrote:
stuff...


even better! i've been away too long, i guess!
Back to top
View user's profile Send private message Visit poster's website
Shin_Kai
Otaku Ultima


Joined: 03 May 2002
Posts: 1683
Location: LOTR land

PostPosted: Fri Feb 13, 2009 7:02 pm    Post subject: Reply with quote

I'm still having trouble. I'm just not sure how to make the codes you gave me work ;-;
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
London
Otaku Ultima


Joined: 27 Feb 2004
Posts: 1879
Location: Montréal, QC

PostPosted: Thu Feb 19, 2009 7:36 am    Post subject: Reply with quote

Post some of the code you've written? It's hard to tell what the problem is without any details.
Back to top
View user's profile Send private message AIM Address
Shin_Kai
Otaku Ultima


Joined: 03 May 2002
Posts: 1683
Location: LOTR land

PostPosted: Thu May 21, 2009 3:20 pm    Post subject: Reply with quote

Sorry this took so long,. Crying or Very sad I really don't understand this type of code. I tried this:

;@begin()
;@unmap("hair1.cel")
;@ unmap("hair2.cel")
;@ unmap("hair3.cel")
;@ map("hair4.cel")
;@ ;@set(1)
;@ map(!skirt)
;@ map(!dress)
;@ map(!top)
;@ map(!shoe)
;@ label(1)

;@press("none.cel")
;@ unmap(#34)
;@ unmap(#35)
;@ unmap(#36)
;@ unmap(#69)
;@ unmap(#70)
;@ label(1)
;@ letinside(I,#47,#51)
;@ ifnotequal(I,1)
;@ unmap(#47)
;@ endif()
;@ letinside(I,#49,#51)
;@ ifnotequal(I,1)
;@ unmap(#49)
;@ endif()

But it told me the label was unreachable in Directkiss which I don't understand at all.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
Lil Loulou
Happy Fun Otaku


Joined: 26 Apr 2002
Posts: 360
Location: At the end of the rainbow

PostPosted: Thu May 21, 2009 6:21 pm    Post subject: Reply with quote

Shin_Kai wrote:
Quote:
Sorry this took so long,. I really don't understand this type of code. I tried this:

;@begin()
;@unmap("hair1.cel")
;@ unmap("hair2.cel")
;@ unmap("hair3.cel")
;@ map("hair4.cel")
;@ ;@set(1)
;@ map(!skirt)
;@ map(!dress)
;@ map(!top)
;@ map(!shoe)
;@ label(1)

;@press("none.cel")
;@ unmap(#34)
;@ unmap(#35)
;@ unmap(#36)
;@ unmap(#69)
;@ unmap(#70)
;@ label(1)
;@ letinside(I,#47,#51)
;@ ifnotequal(I,1)
;@ unmap(#47)
;@ endif()
;@ letinside(I,#49,#51)
;@ ifnotequal(I,1)
;@ unmap(#49)
;@ endif()

But it told me the label was unreachable in Directkiss which I don't understand at all.


Try the following code instead:

Quote:

;@begin()
;@unmap("hair1.cel")
;@ unmap("hair2.cel")
;@ unmap("hair3.cel")
;@ map("hair4.cel")
;@ ;@set(1)
;@ map(!skirt)
;@ map(!dress)
;@ map(!top)
;@ map(!shoe)
;@ gosub(1)

;@press("none.cel")
;@ unmap(#34)
;@ unmap(#35)
;@ unmap(#36)
;@ unmap(#69)
;@ unmap(#70)

;@ label(1)
;@ letinside(I,#47,#51)
;@ ifnotequal(I,1)
;@ unmap(#47)
;@ endif()
;@ letinside(I,#49,#51)
;@ ifnotequal(I,1)
;@ unmap(#49)
;@ endif()


Note that the event "label" is used to define a group of thing to do; while the "gosub" action is calling the label - which means it's executing the group of code it's containing Smile

using gosub(name_or_number_of_the_label) will execute the code in the label and, once done, continue the code following the label in the command which called the label;

using goto(name_or_number_of_the_label) will execute the code in the label; however, once done, it will NOT finish the rest of the code in the command which called label

since you have directkiss, go see the documentation and search "label" for more information Wink
_________________
-Lil Loulou-
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Shin_Kai
Otaku Ultima


Joined: 03 May 2002
Posts: 1683
Location: LOTR land

PostPosted: Thu May 21, 2009 8:26 pm    Post subject: Reply with quote

Thanks, although one quick question. How would you go about executing this code if it were like this:

;@press("skirts.cel")
;@map(!Skirts)

Would it still be letinside or does that code not work?
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
Lil Loulou
Happy Fun Otaku


Joined: 26 Apr 2002
Posts: 360
Location: At the end of the rainbow

PostPosted: Fri May 22, 2009 8:57 am    Post subject: Reply with quote

Let's see...

Quote:

;@begin()
;@ unmap("hair1.cel")
;@ unmap("hair2.cel")
;@ unmap("hair3.cel")
;@ map("hair4.cel")


This part of the code will be executed ONCE after everything is displayed on the screen. I think it would be better to use an "initialize" event instead - maybe someone will be able to confirm.

Quote:

;@set(1)
;@ map(!skirt)
;@ map(!dress)
;@ map(!top)
;@ map(!shoe)
;@ gosub(1)


This part of the code will be executed everytime you enter set 1; you'll need to write this code for every set in which clothes appear - so it's probably best to write the code once in a label and make a call to it Wink

Quote:
Example:
;@label(InitSets)
;@ map(!skirt)
;@ map(!dress)
;@ map(!top)
;@ map(!shoe)
;@ gosub(1)

;@set(1)
;@ goto(InitSets)


Note: Since you're using groups and they are FKiss4, you can use names to define your labels Wink

Quote:

;@ label(1)
;@ letinside(I,#47,#51)
;@ ifnotequal(I,1)
;@ unmap(#47)
;@ endif()
;@ letinside(I,#49,#51)
;@ ifnotequal(I,1)
;@ unmap(#49)
;@ endif()


This code will unmap every skirts that are presently mapped and which aren't inside the body. (I suppose #51 is the zone in which you want the skirts to stay mapped?)

Quote:

;@press("skirts.cel")
;@map(!Skirts)


Writing this code will map every cel in the !Skirts group.

Quote:

;@press("noSkirts.cel")
;@goto(1)


Pressing on this button will execute the code of the label 1; let's say the skirt #47 is inside #51 - it will not be unmapped.

Now, let's say that skirt #49 isn't currently mapped but is inside #51. The code in label 1 verify if the skirt #49 is inside #51 - since it is the case, it will not unmap the skirt. However, since the skirt was already unmapped, it will stay that way.

Is it helping more that way?
_________________
-Lil Loulou-
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Shin_Kai
Otaku Ultima


Joined: 03 May 2002
Posts: 1683
Location: LOTR land

PostPosted: Fri May 22, 2009 3:03 pm    Post subject: Reply with quote

That helps out a lot, thanks so much for that. I think I can code it now, and if I get stuck I'll ask more questions. Wink
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
Shin_Kai
Otaku Ultima


Joined: 03 May 2002
Posts: 1683
Location: LOTR land

PostPosted: Sat May 23, 2009 11:45 pm    Post subject: Reply with quote

So then you'd put each clothing option under a different label I take it. So far it seems to be working well. Smile
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Otaku World Forums Forum Index -> FKiSS Coding All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group