I'm just getting back into 3DGS, but:
If it's the "empty pointer" thing on
cloud.red How are you loading the cloud entity?
You'll need to define it's loading action to assign the cloud pointer itself.
Note- the following is only pseudo/partial code (probably using outdated 3DGS commands

):
Ent_Create("MyCloud",MyPosition,LightningInit)
Action LightningInit{
Cloud=me;
// Other Default assignments for this entity,
// including Event actions or other actions.
}
If the Cloud is being loaded by WED (not script) you'll need to get a handle to the entity, I think using the
ptr_for_name function.
Perhaps:
Cloud=ptr_for_name("MyCloudEnt")
Been a while - - Hope it helps,
-Neut.