Can someone explain to me how this line of code works?

My friend put in this code to my game script
if CollisionDistance < 2 then
else if "pMushroom" = string(collisionModel).char[8..16] then
pInfo = member("Info") 
      pInfo.Text = "Press 'F' to consume Mushroom"
else
end if
else
    pInfo = member("Info") 
    pInfo.Text = ""
  end if
So this is used in my game so that when a ray is less than 2 units away to hits an object named pMushroom, instructions would come up that say "Press 'F' to consume Mushroom" (I'm sure you already knew that though).
I have a bunch of mushrooms out lebed pMushroom01 - pMushroom09
I tried to use this for other models like:
else if "pStick" = string(collisionModel).char[8..16] then
pInfo = member("Info") 
       pInfo.Text = "Press 'F' to take Stick"
But the instructions do not pop up. I've checked that I was the right distance away with my collision detection.
Could someone explain to me the code and what could possibly be wrong?
"char[8..16]" is what I really don't get.

collisionModel is most likely a property variable. So "else if "pStick" = string(collisionModel).char[8..16] then" is taking whatever is in that variable, and setting it as a string. Then it is parsing out the characters in that string from character 8 to character 16 and comparing that sub string to the string pStick.
This works in the first example because "pMushroom" has 9 characters. "pStick" has six characters and so it will never be equal to those characters in collisionModel. You might try:
else if "pStick" = string(collisionModel).char[8..13] then
it may work.

Similar Messages

  • I cannot find a way to sort the bookmark folders themselves alphabetically by name.I am not talking about in a view mode but in the way they are displayed when I click on my bookmarks tab. Can someone explain to me how to accomplish this.

    I have a lot of various book mark folders with websites contained within each folder. I am able to sort the websites within each folder alphabetically by name but I cannot find a way to sort the bookmark folders themselves alphabetically by name.I am not talking about in a view mode but in the way they are displayed when I click on my bookmarks tab. Can someone explain to me how to accomplish this other than manually dragging them as this is extremely hard for me due to the fact that I am a quadriplegic with limited hand movement dexterity

    Bookmark folders that you created are in the Bookmarks Menu folder. "Sort" that folder.
    http://kb.mozillazine.org/Sorting_bookmarks_alphabetically

  • I'm sorry to bother you guys, but this is all new to me! i'm wanting to place my face on another persons photo as a gag. i've been struggling with this all day! could someone explain to me how this is done, in language i can understand???  thanks in advan

    I'm really sorry to bother you guys, but this is all new to me! i'm trying to put my face on another persons photo as a gag! i have been struggling with this all day! can anyone explain to me how  this is done in language i can understand???  thanks in advance!

    What software do you own?  Give details, please.
    Photoshop is a professional level application that makes no apologies for its very long and steep learning curve.
    It's not something you can learn in a forum, question by question.  Teaching someone Photoshop from scratch exceeds the scope of this or any other forum.
    The process involves isolating your face, by selecting it and deleting the unwanted parts around your face or with layer masks, then placing it as a new layer on top of your target image, making sure it's the right size, color, lighting, etc.  Google for tutorials on any of those elements you are unfamiliar with,

  • Can someone explain to me how to use Xcode?

    I just got the app Xcode and I am so exited to use it. But once I tried it, I was so confused. Can someone explain to me how to use Xcode?

    Become a paid developer, download all the thousands of manual pages and read them.
    developer.apple.com

  • I would like to download / backup my entire iPhoto library, but want to do so in a manner where each event is saved as a distinct folder.  Can someone please advise if / how this is possible?

    I would like to download / backup my entire iPhoto library, but want to do so in a manner where each event is saved as a distinct folder.  Can someone please advise if / how this is possible?

    See Terence Devlin's User Tip on exporting from iPhoto: 
                     Exporting From iPhoto  https://discussions.apple.com/docs/DOC-4921
    To write events to separate folders, use "File > Export" and select the subfolder format "Event Name". But that will only backup the photos and not your iPhoto library and all the work you invested in organising it.  For backing up, see:                    iPhoto and File Management

  • Can you explain me clearly how to make company code visible in cost center

    can you explain me clearly how to make company code visible in cost center master data using tcode kmlv

    Hi,
    There is no way to activate the company code field. If your Controlling Area and Company Code have one to one Assignment, then Company code is defaulted from the Controlling Area. However, if multiple Company Codes are assigned to one Controlling Area, then Company Code becomes a mandatory field in the Cost Center master data
    Also, in case you have multiple company codes assigned to one controlling area, please check the setting of the Controlling Area in Configuration and see if have selected "Cross Company Code Cost Accounting" . Also, check if you have assigned all the company codes to the controlling area
    Regards
    Mahendra

  • Can someone explain to me how to correct this problem??

    I first want to thank anyone who reads my post and responds to it.. These boards have taught me so much over the years... My G4 450 or what I call my plow horse has
    recently started to run slowly especially while i tried to surf the web.. I decided to run Disk First Aid While it was running a highlighted Invalid B Tree Header,O,O, appeared then Highlighted was Mount check found minor errors. then it continues for a few seconds and I get message cannot continue an internal error has occured. I re ran the First Aid several more times but same messages each time. Can I fix these problems or is it time to put my Mare out to pasture...:( Thanks in advance for your answers........

    Hi, Colleen -
    I followed your directions and looked up the Boot Rom version it read $0004,28f1
    That indicates your G4 is at firmware version 4.2.8, which is the most recent version for it - there is no further update, so your machine is OSX-ready.
    I typed this in appleworks and when i went to save the message i get an error message so I tried again it would not let me save my notes. I wrote it down turnred my mac off and my daughter got on it a few hours later and calls me because at start up it goes through the usual functions but then on my screen its the Extensions manager.. This has never happened.
    There is a startup keyboard command which will call up Extensions Manager before extensions start to load - this allows altering the current set of extensions during startup, which can be quite useful when trouble-shooting. The startup command which does that is to hold down the Spacebar from the beginning of startup. Since Extensions Manager apparently was called up during startup, it would indicate that either the Spacebar is stuck down occasionally, or something was resting on the Spacebar when your daughter started it up (the corner of an open book has been known to be sufficient to do that).
    There is also the possibility of something else causing Extensions Manager to open - this would be the case if it appears after the desktop has loaded. Causes for that include having an alias to Extensions Manager in the Startup Items folder.
    Everything listed is xed the first in list Airport AP is highlighted I know my computer did not have airport card when i bought it...
    Everything will be checkmarked if the "On/Off" column header (the label box above the checkboxes) is clicked - it's a toggle. If that was done, the only way to undo it is to de-select (uncheck) individual items.
    ...so I highlighted start up icon on list.
    That will do nothing - control panels (such as Startup Disk) can not be engaged (opened) from within Extensions Manager.
    Will this problem be corrected by Disk Warrior also? If so will i still need to buy the Disk no newer then 2.1.1.
    Until the damage reported has been fixed, odd things may start happening - the longer you wait, the less stable the OS will be.
    Since your firmware has been updated to 4.2.8, it is okay to use the current version of DiskWarrior, one which boots to OSX.

  • Can someone explain the structure behind this common practice in most flash websites?

    I'm kind of a newbie with flash. I havent used it in a long long time and when I was using it, I wasnt really fully understanding what I was doing at the time. Anyways, it's been like 10 years now and I have to use it to make a website, but I can't figure out how others are doing this specific thing. I understand the basic concept of how flash works with making a website, and I've even built a very basic website with audio/video and mouse interaction, but now I want to step it up. I've seen many flash websites before and some have a lot of things going on at once and I'm wondering how you implement that smoothly while still allowing mouse interaction and navigation. I know this sounds confusing but basically, what I mean is:
    let's say I have a website and on the website I have buttons that lead to different pages(frames) when clicked. On the main page I have something like a bird that flies from left to right. Let's say that the bird is in the middle of the screen and a user clicks a button. How do I make it so that the bird continues to fly off screen before switching pages? Obviously, I cant tell what the location of the bird will be when the button is clicked since it will vary from user to user so I am completely confused on how to structurally set this up. Would the bird be it's own swf embedded in the main swf? Or is this feature a massive keyframing project for every frame of animation that bird has?
    Also, how do have multiple animations that run on different clocks looping simultaneously? What I mean by this is, lets say the previously mentioned bird has a 25 frame animation loop and a second element, like a sunrise/sunset has a 30 frame animation loop... how do I loop both of them so that they loop seemlessly at the same time? Will I have to animate both of them in a loop until both reach a common frame (150 frames from 6x 25frame bird loops and 5x 30frame sunrise/sunset loops)?
    Thanks,
    MorisatoKei

    You will have to experiment to see what works well and what doesn't.   You can have things animating along a timeline in parallel, but you can also have them be their own movieclips and animated when commanded to play().
    In the case of your bird flying off before a button click is processed, you could manage that as follows.  Have the button set a variable that is defaulted at false to be true.  At the end of the bird's flight, you test that variable ( as in ... if(variable == true)...) to see if it is true, and if so, you process whatever command that button is intended for.  If you used a timeline animtion for the bird, then that test would occur at the last frame of the animation.  If you used a coded tween to move the bird across the scene, then you could use an event listener to detect the animation completed and do the test then.
    There are almost always a variety of choices for achieving the same design goal.  The key to determining a solution is knowing what tools you have to work with... and coming to know what those tools are and how to use them is where learning comes in.

  • Alright, can someone explain to me how to re-download Adobe Photoshop?

    I was given a wacom tablet, and an adobe photoshop back in 2007. I adored it. That computer crashed, and I figured out how to redownload it on my laptop... that has, since then, also broken. I was looking into how to redownload it once again onto my new computer.
    I can find my serial number. I have my sign in information. It even notices that I have Photoshop already. But I cannot find a link to download it. It's beyond frustrating.
    Ive checked under "my orders" and I dont have any, so I cannot download it from there. =/

    I appreciate this suggestion, but it isnt on this website. =/
    Searched through it manually, and also used the search toolbar. The only thing pertaining to "Photoshop Elements 5" it had was a comparison page.
    I'd call customer service, but I honestly dont have 35$ I can just throw at it to call them.

  • Can Someone explain in detail how to restart

    i have been trying to restart my ipod all day using the directions but i need some one who knowns how to do it to explain or has done it and does it matter if it is on hold

    Have you been following these instructions:
    1. Toggle the Hold switch on and off. (Slide it to Hold, then turn it off again.)
    2. Press and hold the Menu and Select buttons until the Apple logo appears, about 6 to 10 seconds. You may need to repeat this step.
    From here:
    http://docs.info.apple.com/article.html?artnum=61705
    It shouldn't be anything more than this to restart your iPod. You could also let the battery run down completely until the iPod shuts off, then re-charge it and re-start it from there.

  • Can someone explain, and/or justify this?

         x=app.activeDocument.viewPreferences.horizontalMeasurementUnits
         Result: PICAS
    // so far, so good.  Just to be sure...
         x.toString()
         Result: PICAS
    // now
         x+x
         Result: 4108374726
    // huh?
         x+x.toString()
        Result: 2054187363PICAS
    // and finally
        "units are "+x
        Result: units are 2054187363
    I suppose there's some explanation why the measurement units for picas is secretly associated
    with the integer 2054187363 and why it's a good idea.

    > it still doesn't make sense that "picas" and friends should have these
    > I'm-also-a-number behaviors that do make sense for special characters
    The I'm-also-a-number behavior does not actually make sense whatever the enum you consider, it's just the way those objects work.
    Note, however, that Enumerator instances do not have the cast Number (the typeof operator does return 'object'). What has been done when introducing these objects in CS5 is:
    1. Making myEnum.valueOf() return a Number.
    2. Overriding == and === so that myEnum can match a Number in both equal and strict-equal comparisons.
    The reason for this, IMHO, was to preserve compatibility with previous versions (CS4 and before) where Enumerations—the collection of enums—were just pointing out to numeric values, that is, Numbers.
    Thus, a syntax like (myUnit===MeasurementUnits.INCHES), or (myUnit===2053729891), or even (MeasurementUnits.INCHES===2053729891), still works from CS4 to CS5 without breaking existing code.
    Now, about the meaning of these numbers, we know they are nothing but unique identifiers. Technically—and this is an old tradition in Adobe architecture—such identifiers are all built based on 4-character sequences.
    In the case of measurement units, identifiers are formed using the prefix 'z' and 3 relevant letters from the unit name, usually the leading letters, e.g. 'zinc' for inches, 'zpic' for picas, and so on.
    Then, ASCII codes of these characters are taken to build a number:
    INCHES => z i n c => 7A 69 6E 63 => 0x7A696E63 (=2053729891 in decimal)
    PICAS => z p i c => 7A 70 69 63 => 0x7A706963 (=2054187363 in decimal)
    etc.
    And you will check that +MeasurementUnits.INCHES is 0x7A696E63.
    Anyway, your comment #5 highlights something else, based on the code:
    var x = MeasurementUnits.picas;
    var y = 2054187363;
    var z = "2054187363";
    We have checked, indeed, that x===y is true (see reason 2 above).
    But we also can check, as you mention, that x===z is true!!! Which is not CS4-backwards-compatible at all and sounds highly irrelevant since x.toString()==='PICAS'.
    I suspect that this strange case is a side effect of how the === operator has been overloaded. In my opinion, the hidden function Enumerator['==='](arg) mutely coerces the argument into a Number whatever it actually is. So the string z is simply taken as +z and that's why x===z also returns true. What Adobe should have done instead is:
    // JS pseudo code
    Enumerator['==='] = function(arg){ return 'string'==typeof arg ? this.toString()==arg : this.valueOf()==+arg };
    …and then x===z would have been false, and x==='PICAS' would have been true ;-)
    @+
    Marc

  • Can someone explain 'Sync' and how it sends mail

    I've lost a lot of emails
    Heres the scenario.  Between the hours of 9pm and 4pm (work days) I disable Sync and Email Sync. So lets start with MSN (others)
    Its 9pm, I launch MSN (others) email application, I hit refresh one last time, then I go into settings, account settings etc etc and uncheck the box that says 'Sync Email'
    Next since I have a google account I also go into settings and uncheck the box that says 'sync email'
    Then so I can get the full battery life possible I pull down my notification menu and select all and uncheck the radio button that says 'Sync'...and that lasts from 9pm as I sleep...and my work shift is like 7am to 4pm (ish) and then I will re enable it all.
    Now lets say at 10am I'm going thru twitter and theres an article thats a long one and I want to read it when I get off work....I hold down the tweet and see an option that says "Share", I select Gmail because I prefer reading it off of MSN (my choice!) anyways, I can go thru and select a lot of stuff and share it, by sending an email.
    Now heres the thing....I know if I were to launch my MSN Mail at 10:05am I wont get it, duh! because I have Sync off right? So once I enable each of the emails' Sync Option and enabling the Device' Sync option....I then will receive the email or emails...which I do...every single time and by everytime I mean 10 emails sent by me, per day (ish) every day for over a month.
    Now....heres my problem
    I was viewing web pages...I chose Share....I chose send via MSN to GMail (odd I know)...but prior to enabling Sync I actually performed a Factory Reset on Device/Phone...so it was like a brand new phone...
    However once I enabled Sync and refreshed a few times I havent received the emails nor am I finding it in the "drafts or sent folders"
    So I ask....what is the proper steps my phone is taking that somehow sends these "ghost emails"
    Heres my theory: I mean lets say I view a webpage; all sync's are disabled; I choose 'Share to this email address'...does my phone create a file on Devices Memory and its called "sendemail1togmail.mail" and if I choose to share another webpage it creates another file called "sendemail2togmail.mail" meanwhile those are temp files...kinda like temporary files when you are downloading a file off a webpage. (aka Partial)....then when you enable Sync on all of them...it searches for any .mail files off the device and thus sends it appropriately??????
    If so; great where do the files get saved to? Because next time I'm either keeping sync on or I'll just copy the files to my SD card then I'll copy it back again
    Because either way...I dont have the emails I sent
    Thanks

    sync doesn't send emails, only synchronizes between pc & phone.
    yours is the goofiest way of syncing i've heard of.
    i sync 4 email acc'ts, 2 are pop3, yahoo & gmail & they all work as you'd expect.

  • Can someone explain to me why this is happening

    Ok I am trying to add two values in an update statement. Part of my code is as follows:
    update account a
    set a.total_term_births =( SELECT b.total_term_births
    FROM ACCOUNT b
    WHERE b.account_id = 98778
    +
    a.total_term_births )
    where a.account_id = 98777
    The answer I am expecting is 5244, but
    SQL> select total_term_births from account where account_id = 98777
    2
    SQL> /
    TOTAL_TERM_BIRTHS
    268
    Now, if I change the above coorelated sub query to as follows:
    update account a
    set a.total_term_births = ( a.total_term_births + (
    SELECT b.total_term_births
    FROM ACCOUNT b
    WHERE b.account_id = 98778 ))
    where a.account_id = 98777
    I get 5244 the correct answer. In my mind both syntaxes are correct.
    Am I right in my assumptions.

    You are not getting the expected results with the first version because the subquery is looking for an account_id value of (98778 + the_value_of_a.total_term_births). So, if row 1 had a total_term_births value of 123, the correlated subquery would be looking for an account_id of 98901, and if row 2 had a value of 50, the subquery would be looking for an account_id of 98828, and so on. This is not what you want at all.
    The second version is the correct version of the query.

  • Can someone explain why ati radeon mac 9700 pro: not working in MDD?

    Hi,
    I might have posted a long thread about the 9700 mac pro video card that I just got, however why for some reason its working in the Digital Audio machine I have and not in my MDD machine? When I connect it to the AGP 4X slot and turn on the computer, I get nothing but a black/cold screen.
    And yes, I have the molex connected to the power supply? I am trying to figure out where I am going wrong with connecting this video card up to my MDD mac. Works in the DA machine, but not in the MDD.
    It required me to tape pins 3 and 11 and I bought it off of ebay. I might appear to be a pc card, though the PCB is red in color.

    Oh this helps!
    What is so different that the card won't work in my computer? Remember, though the seller told me through his ad on ebay that it is a MAC card, I highly doubt that it was a real mac card to begin with, but rather a PC card because in the end he told me to tape pins 3 and 11 - but his ad did not mention this.
    I have also done an in depth analysis of my entire system using techtool pro and the AHTCD - Both have determined that there is nothing wrong with my system at all.
    So, what is the conclusion as to why it worked in my Digital Audio machine and not the MDD? Can an MDD refuse a PC video card flashed w/mac firmware? Is it some sort of smart slot?

  • Can someone explain purchasing, activating and signing up for iPhone.

    Hi, iPhone hits UK in November and I'd like to be prepared. Can someone explain to me how it's going to work. In the USA where do you buy the phone - the Apple store, and what do you do just walk in a buy the actual phone as if it were an iPod? And then how does activation work? What is it, just registering the iPhone with Apple or signing up with the network provider? What stops you from just buying the phone and putting another AT&T or O2 sim in and not signing up for one of the contracts?

    Presuming that it will look pretty much the same as it did for US customers, it will be something like this..
    You walk into your local Apple store and purchase an iPhone, or you can order one through the UK online Apple store (or, presumably, O2 will sell them in their local shops).
    You connect the iPhone to any computer which meets the minumum system requirements. It will recognize a new, unactivated iPhone and take you through the activation, which includes:
    1. Entering your name, address, and payment info
    2. Create an iTunes Music Store account if you do not already have one
    3. Select which type of call plan you want (how many call minutes, how many text messages, etc)
    4. Specifying whether you want a new number assigned or want to port your number from another provider (assuming this can be done in the UK)
    You will then wait while the activation is completed, which can take several minutes. Once your phone is activated you will be able to make calls, send text messages, and use all the other functions of the iPhone, including syncing your contacts, calendars, and music to it. If you are porting a number from another service, once the port is complete you will be able to receive calls. If you are being assigned a new phone number, you will be able to receive calls right away.

Maybe you are looking for