Hi everyone.
So I finally resolved to get into plugin creation.
I'm a new VAM user and also a c# beginner and not a pro coder at all but I have managed to make a first simple shitty plugin for personnal use, and now I want to dig deeper (I have a few c++ skills so I'm not a total newbie).
I'm sure there is a lot of things I still need to learn so I'll try t break it into small questions, and hopefully get one of the local gurus to mentor me
Right now I'm trying to wrap my head around atom spawning and manipulation from scripts. I'm trying to play with the SuperController.singleton.AddAtomByType() instruction.
To put it short, here's what bothers me :
I also struggle to "grab" the aotm once spawned.
for example :
Basically I'm trying to find a reliable way to spawn an atom and "grab" it in memory to customise it, I can't understand why the GetAtomByUid function grabs the person but not the CUA
(I've tried with GetAtomById() too with the same results), and I Feel I'm missing a correct reliable way to create an atom, manipulate it in memory BEFORE instanciate it, whithout the need to use some tricky string search based function to "grab" the atom afterwards.
Something like:
Right now, I'd like to spawn an CUA with a particular UID, but as I can't neither specify it on spawn, nor grab it when it spawns with the default name, I can't do anything with it.
For reason I can't understand, I can do it with a person, but not a CUA... What am I missing ?
Any good soul to help me through this ? ^^
PS: I'm not a native english speaker so I hope I'm clear enough, especially when it comes to tech things...
Thanx in advance for answering !
So I finally resolved to get into plugin creation.
I'm a new VAM user and also a c# beginner and not a pro coder at all but I have managed to make a first simple shitty plugin for personnal use, and now I want to dig deeper (I have a few c++ skills so I'm not a total newbie).
I'm sure there is a lot of things I still need to learn so I'll try t break it into small questions, and hopefully get one of the local gurus to mentor me
Right now I'm trying to wrap my head around atom spawning and manipulation from scripts. I'm trying to play with the SuperController.singleton.AddAtomByType() instruction.
To put it short, here's what bothers me :
C#:
private void Callback()
{
SuperController.singleton.AddAtomByType("CustomUnityAsset");
// won't compile, because the call is ambiguous
}
private void Callback()
{
SuperController.singleton.AddAtomByType("CustomUnityAsset","MyUID");
//will compile, but the atom doesn't spawn
}
private void Callback()
{
SuperController.singleton.AddAtomByType("CustomUnityAsset","MyUID", false, false, false);
//will compile, but the CUA doesn't spawn
}
private void Callback()
{
SuperController.singleton.AddAtomByType("CustomUnityAsset", false, false, false);
// CUA Spawns with default UID
}
I also struggle to "grab" the aotm once spawned.
for example :
C#:
private void Callback()
{
Atom myAtom=new Atom();
SuperController.singleton.AddAtomByType("Person", false, false, false);
myAtom = SuperController.singleton.GetAtomByUid("Person");
SuperController.LogMessage(myAtom.toString());
} // will work, "Person" atome spawns and is stored in the Atom object
private void Callback()
{
Atom myAtom=new Atom();
SuperController.singleton.AddAtomByType("CustomUnityAsset", false, false, false);
myAtom = SuperController.singleton.GetAtomByUid("CustomUnityAsset");
SuperController.LogMessage(myAtom.toString());
} // spawns CUA but not stored in myAtom
Basically I'm trying to find a reliable way to spawn an atom and "grab" it in memory to customise it, I can't understand why the GetAtomByUid function grabs the person but not the CUA
(I've tried with GetAtomById() too with the same results), and I Feel I'm missing a correct reliable way to create an atom, manipulate it in memory BEFORE instanciate it, whithout the need to use some tricky string search based function to "grab" the atom afterwards.
Something like:
C#:
Atom myAtom=new Atom();
myAtom = CreateAtomFunction(type, UID, etc.);
//..do things with myAtom
myAtom.Instanciate();
Right now, I'd like to spawn an CUA with a particular UID, but as I can't neither specify it on spawn, nor grab it when it spawns with the default name, I can't do anything with it.
For reason I can't understand, I can do it with a person, but not a CUA... What am I missing ?
Any good soul to help me through this ? ^^
PS: I'm not a native english speaker so I hope I'm clear enough, especially when it comes to tech things...
Thanx in advance for answering !