g4m3w0rm Posted September 11, 2014 I'm trying to fire a plasmagun from multiple mapspots with one script. The plasmaballs need to follow the angle of the mapspot. Right now this is what I am doing.script 4 (int tagID) { SpawnProjectile(tagID,"PlasmaBall",GetActorAngle(tagID)/256,20,0,0,0); PlaySound(tagID,"weapons/plasmaf"); } A linedef triggers the script and when there is only one mapspot firing this is no problem. When more mapspots have to fire at the same time the angle won't be correct because these mapspots have the same TID. Is there any way to fire these plasmaballs in the angle of the firing mapspots? Thanks in advance, g4m3w0rm 0 Share this post Link to post
Blue Shadow Posted September 11, 2014 Try this example:#define MAPSPOTS_NUMBER 4 // We have four points (mapspots) from which the plasma ball will be fired int mapspots_tids[MAPSPOTS_NUMBER] = {5, 7, 19, 8}; // The tids of said mapspots Script 4 (void) { For(int i; i < MAPSPOTS_NUMBER; i++) SpawnProjectile(mapspots_tids[i], "PlasmaBall", GetActorAngle(mapspots_tids[i]) >> 8, 200, 0, 0, 0); } The setup expects you to have four mapspots in the map with tids: 5, 7, 8, and 19. 0 Share this post Link to post
g4m3w0rm Posted September 11, 2014 Thanks for the reply. This is a good idea but I am actually trying to make a reusable script for different linedefs (with arguments). A linedef with an argument would fire all mapspots with the TID in the argument. To do this I would need more than 3 arguments in the linedef action. Maybe I could try using successive numbers. The only downside is that the number of mapspots is fixed like this. This just gave me an idea. Perhaps I can use the first argument as the first TID and the second argument to define the number of mapspots. script 4 (int tagID, int MAPSPOTS_NUMBER) { for(int i=tagID; i < tagID+MAPSPOTS_NUMBER; i++) { SpawnProjectile(i,"PlasmaBall",GetActorAngle(i) >> 8,20,0,0,0); PlaySound(i,"weapons/plasmaf"); } } This works! Thanks. 0 Share this post Link to post
Edward850 Posted September 12, 2014 You don't need to independently play "weapons/plasmaf", the plasmaball class itself already does this. 0 Share this post Link to post