Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    global variables?

    General Discussion
    0
    2
    766
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 18/04/2003 at 15:11, xxxxxxxx wrote:

      I was going to implement a simple flocking algorithm in COFFEE, but I need a way to store information about each child of an object. I would need to store velocities and things like that. I can't find anything that suggests this can be done, but I thought I'd throw it out here and see if anyone has some ideas.

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 19/06/2011 at 11:59, xxxxxxxx wrote:

        I know this Thread is veeeery old, but for those who search for:

        In a Coffeetag, you better use a struct:

        struct MyStoredData {   
        var velocity;   
        var position;   
        var acceleration;   
        }   
          
        var data = new(MyStoredData);   
          
        main(doc, op) {   
        data.velocity = ... 
        

        In a Plugin or Dialog for instance, you better define such variables as Class Attributes:

        class MyPlugin : MenuPlugin {   
        private:   
            var velocity, acceleration, position;   
        public:   
            MyPlugin();   
            ...
        

        (I hope the Syntax etc is right, its along time ago I did Coffee ..)

        Cheers,

        1 Reply Last reply Reply Quote 0
        • First post
          Last post