11.11.2015, 11:36
Hey, I'm a beginner scripter (like really beginner) and I started to mess around with actors lately. Now, I had some troubles and I did found a topic that talks about a similar problem here but the guy who made the topic has reported it as a bug, and I don't know if in my case it's a bug or it's just me being really stupid about it. So the problem is this;
I tried adding a few actors (6 I think?) in a club interior, and apply an animation to them (like dancing sitting etc) and I tried it a few times. In the first time, all the actors has appeared to me, but without any animation. Then, I looked in the forums and found a better way to spawn the actors, like,in the beginning I was just creating a variable for each actor, like this;
Now as I said before, I found a better way of creating the actors (at least that what they said), and did it like this;
But then I tested it, and only the first actor has appeared in-game. Then, I reversed everything to as it was in the first time and it didn't spawn the actors too, it just spawned the first actor.
I don't know if the solution is that obvious and I'm being stupid or it's just a bug or something like that, but something doesn't work out here for me and I have no idea why. I would love to have some help from you and maybe gain a little bit of scripting knowledge as well.
NOTE: I did tried to post this topic on the "0.3.7 RC scripting" board but I couldn't do it for some reason
I tried adding a few actors (6 I think?) in a club interior, and apply an animation to them (like dancing sitting etc) and I tried it a few times. In the first time, all the actors has appeared to me, but without any animation. Then, I looked in the forums and found a better way to spawn the actors, like,in the beginning I was just creating a variable for each actor, like this;
Код:
new DFCactor1; new DFCactor2; new DFCactor3; public OnGameModeInit() { DFactor1= CreateActor(13,490.5765,-16.6661,1000.6797,12.1928); if (!IsValidActor(DFactor1)) return DFactor1=CreateActor(13,490.5765,-16.6661,1000.6797,12.1928); if (IsValidActor(DFactor1)) return ApplyActorAnimation(DFactor1,"DANCING","dance_loop",4.1,1,0,0,0,0); // goes like this for every actor with different animations }
Код:
enum actors{ DFactor1, DFactor2, DFactor3 } new ActorID[actors]; public OnGameModeInit() { ActorID[FDactor1]=CreateActor(13,490.5765,-16.6661,1000.6797,12.1928); if (!IsValidActor(ActorID[FDactor1])) return ActorID[FDactor1]=CreatActor(skinid,X,Y,Z,Xrotation); if (IsValidActor(ActorID[FDactor1])) return ApplyActorAnimation(DFactor1,"DANCING","dance_loop",4.1,1,0,0,0,0); // etc... }
I don't know if the solution is that obvious and I'm being stupid or it's just a bug or something like that, but something doesn't work out here for me and I have no idea why. I would love to have some help from you and maybe gain a little bit of scripting knowledge as well.
NOTE: I did tried to post this topic on the "0.3.7 RC scripting" board but I couldn't do it for some reason