Anonymous user
Scripting, Code & Interaction: Difference between revisions
→AGS Pointers for Dummies (A reference for the rest of us!)
Line 383: | Line 383: | ||
stEgo.Char = cEgo; | stEgo.Char = cEgo; | ||
If you know how to use structs, then you will already understand what the integer values are for (if you don't check the manual), but what about this Character* (pointer to Character)? By storing this information, you can easily use '''stEgo''' ''in place of'' '''cEgo'''. Where you would normally type something like ''cEgo.Animate'', you would simply type ''stEgo.Char.Animate''. | If you know how to use structs, then you will already understand what the integer values are for (if you don't [http://www.bigbluecup.com/manual/struct.htm check the manual]), but what about this Character* (pointer to Character)? By storing this information, you can easily use '''stEgo''' ''in place of'' '''cEgo'''. Where you would normally type something like ''cEgo.Animate'', you would simply type ''stEgo.Char.Animate''. | ||
This is one of the most useful reasons for pointers as, to an extent, it can allow you to extend built-in types. | This is one of the most useful reasons for pointers as, to an extent, it can allow you to extend built-in types. |