[project1dev] Re: global variable questions

  • From: Alan Wolfe <alan.wolfe@xxxxxxxxx>
  • To: project1dev@xxxxxxxxxxxxx
  • Date: Fri, 26 Jun 2009 18:48:54 -0700

yeah you got it!

there's a number that starts at 1 and every time something is loaded, it
gets the current id and then the id is incremented.

you probably saw that kind of thing in a database class with "autoincrement"
columns in tables i bet
On Fri, Jun 26, 2009 at 6:42 PM, Nick Klotz <roracsenshi@xxxxxxxxx> wrote:

> So only standard variables can/should be stored globally.  Models get a new
> UID every load based on the order in which it was processed?
>
>
> On Fri, Jun 26, 2009 at 8:39 PM, Alan Wolfe <alan.wolfe@xxxxxxxxx> wrote:
>
>> and the answer, that kent probably found out is that NO you cannot store a
>> model in a global variable (:
>>
>> the reason why is because every time a model is loaded, it gets a unique
>> ID# and the next time a peice of art is loaded it may not be the same ID#.
>>
>> If it is, you got lucky, but you shouldn't rely on it being true.
>>
>> hope that isnt too confusing, the same is true of mobs, lights, and other
>> such things
>>   On Fri, Jun 26, 2009 at 6:31 PM, Nick Klotz <roracsenshi@xxxxxxxxx>wrote:
>>
>>> From my understanding of variables, global just means it encompasses the
>>> entire code, rather than stuck into one specific function; so I would say
>>> yes, they're used just the same as a standard variable.
>>>
>>>  On Fri, Jun 26, 2009 at 8:27 PM, Kent Petersen <kentkmp@xxxxxxxxx>wrote:
>>>
>>>> Can global variables be used just like regular variables. For example I
>>>> was thinking about storing the players form in a global variable. So when 
>>>> he
>>>> talks to the old man and it changes your body, your body form caries over 
>>>> in
>>>> and out of the tent. Would I need to do anything special?
>>>>
>>>
>>>
>>
>

Other related posts: