• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Points

Status
Not open for further replies.
Level 13
Joined
Jun 20, 2014
Messages
479
Ehh is storing point into an indexed variable even possible? I tried storing a point into a temporary variable then stored it into an indexed variable. Im losing the saved point as soon as i destroy the temp point. So i was wondering if you index the point and it gets destroyed during deindex will the spell still properly? Or it can be fixed by simply not storing the point into a temp variable
 
Variables are pointers that point on a part in memory.
If you do "A = B" with objects, it just copies the pointer from "A" to "B" but does not copy the object itself.
A new object won't get created here, but now you have 2 variables pointing on the very same object.
So if you destroy the object from variable "A", the pointed object for "B" also gets destroyed and vice versa.

Your:
Set A = CreatePoint(x,y)
Set B = A
Destroy A
// Now both are destroyed

Solution
Set A = CreatePoint(x,y)
Set B = CreatePoint(x,y)
Destroy A

Or what an idea might be is just not to use a temp variable for it.
I mean you anyway index it, so you might used just the indexed point.
 
Status
Not open for further replies.
Top