Jump to content


Photo

Object Not Reading Other Object's Variables


  • Please log in to reply
23 replies to this topic

#1 airikita

airikita

    GMC Member

  • New Member
  • 408 posts

Posted 10 July 2007 - 01:05 AM

I have the object changing sprites when the player reaches a certain point in their variable, but it's not reading it. I'm using these icons in order:
:)
;)
  • 0

#2 manyquestions

manyquestions

    GMC Member

  • GMC Member
  • 1426 posts
  • Version:GM8.1

Posted 10 July 2007 - 01:09 AM

Did you remember to preced the variable with original_object's_name.?

Edited by manyquestions, 10 July 2007 - 01:09 AM.

  • 0

#3 kennypu

kennypu

    Black Fire Games

  • New Member
  • 1075 posts

Posted 10 July 2007 - 01:11 AM

objname.var
  • 0

#4 Nuble

Nuble

    United We Stand

  • New Member
  • 1741 posts

Posted 10 July 2007 - 01:14 AM

Also try to avoid using = because sometimes it'll skip over tthe assinged value.

More details on your game would help
  • 0

#5 airikita

airikita

    GMC Member

  • New Member
  • 408 posts

Posted 10 July 2007 - 01:19 AM

1. I'm using icons
2. you mean like "object.variable" in :)? It tells me it's not a variable, it's usually "global.variable" right?
3. I just put the 2 variables in order, AND ;) has other: "object_here" selected.
  • 0

#6 manyquestions

manyquestions

    GMC Member

  • GMC Member
  • 1426 posts
  • Version:GM8.1

Posted 10 July 2007 - 01:27 AM

If you set "applies to:" to any object other than self, that's the object that will make the change. If obj_a is the one executing the action and it's trying to read obj_b's variable but you want obj_a to make the change depending on b's variable, you need to set "applies to:" to self and shange the "variable" field to obj_b.variable. You'll need to chage the word variable to whatever the exact bariable's name is that you're trying to read.
  • 0

#7 airikita

airikita

    GMC Member

  • New Member
  • 408 posts

Posted 10 July 2007 - 01:32 AM

If you set "applies to:" to any object other than self, that's the object that will make the change.  If obj_a is the one executing the action and it's trying to read obj_b's variable but you want obj_a to make the change depending on b's variable, you need to set "applies to:" to self and shange the "variable" field to obj_b.variable.  You'll need to chage the word variable to whatever the exact bariable's name is that you're trying to read.

<{POST_SNAPBACK}>

Yes, and it returns the same bloody error! "OBJ_B.VARIABLE IS NOT A VARIABLE NAME... VARIABLE NAME EXPECTED!!!" don't contradict this again people!
  • 0

#8 manyquestions

manyquestions

    GMC Member

  • GMC Member
  • 1426 posts
  • Version:GM8.1

Posted 10 July 2007 - 01:37 AM

Did you replace obj_b with the actual name of your object?

Are you using a non-built in local variable? If so, you'll need to initiate it in the create event of obj_b by putting variable=0.
  • 0

#9 Y@M$

Y@M$

    GMC Member

  • New Member
  • 32 posts

Posted 10 July 2007 - 01:39 AM

There are two things that I can think of:

1.  Make it a global variable (yes this does work for D&D).  Type in "global.<variable>", and use that for both.
2.  Up at the top, Unselect "Self" and go to "Other," and choose the other object that you want from the dropdown.

I hope that helps! :)
  • 0

#10 airikita

airikita

    GMC Member

  • New Member
  • 408 posts

Posted 10 July 2007 - 01:42 AM

(OK, wtf does copy and pasting work, but typing it accurately the errors b**ch at me?) Now it tells me the first variable doesn't exist, and I copy and pasted it too.
  • 0

#11 airikita

airikita

    GMC Member

  • New Member
  • 408 posts

Posted 10 July 2007 - 01:44 AM

There are two things that I can think of:

1.  Make it a global variable (yes this does work for D&D).  Type in "global.<variable>", and use that for both.
2.  Up at the top, Unselect "Self" and go to "Other," and choose the other object that you want from the dropdown.

I hope that helps! :)

<{POST_SNAPBACK}>

Ya... that was obvious in the first post, I'm not a noob here.

But if I set it to the object I'm trying to fix, it'll give me those errors again.

Edited by airikita, 10 July 2007 - 01:45 AM.

  • 0

#12 manyquestions

manyquestions

    GMC Member

  • GMC Member
  • 1426 posts
  • Version:GM8.1

Posted 10 July 2007 - 01:44 AM

Did you initiate it?
  • 0

#13 airikita

airikita

    GMC Member

  • New Member
  • 408 posts

Posted 10 July 2007 - 01:45 AM

Did you initiate it?

<{POST_SNAPBACK}>

initiate what?
  • 0

#14 Nuble

Nuble

    United We Stand

  • New Member
  • 1741 posts

Posted 10 July 2007 - 01:46 AM

initialize, set the variable to 0 when the room_starts
  • 0

#15 airikita

airikita

    GMC Member

  • New Member
  • 408 posts

Posted 10 July 2007 - 01:51 AM

Well yes, cuz the variable changes and sets back to 0 when stopped.
  • 0

#16 manyquestions

manyquestions

    GMC Member

  • GMC Member
  • 1426 posts
  • Version:GM8.1

Posted 10 July 2007 - 01:53 AM

I f it changes then how does it not exist?
  • 0

#17 airikita

airikita

    GMC Member

  • New Member
  • 408 posts

Posted 10 July 2007 - 01:56 AM

yes... I'd like to know that too....

c'mon, be more specific.. I have no idea what they did to GM7 here!
  • 0

#18 manyquestions

manyquestions

    GMC Member

  • GMC Member
  • 1426 posts
  • Version:GM8.1

Posted 10 July 2007 - 02:13 AM

Oh, I don't know how different they are, but I've been talking about 6.1.
  • 0

#19 airikita

airikita

    GMC Member

  • New Member
  • 408 posts

Posted 10 July 2007 - 02:20 AM

Yea, apparently GM7 is more decisive about codes than GM6.1.. I need help with this.

Edited by airikita, 10 July 2007 - 02:21 AM.

  • 0

#20 Nuble

Nuble

    United We Stand

  • New Member
  • 1741 posts

Posted 10 July 2007 - 02:21 AM

They arn't different. All there is, is an extension package button and a few bug patchs. I hardly notice a difference.
Could you explain it again I'm not sure I understand.

Edited by Nuble, 10 July 2007 - 02:22 AM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users