cyber-menace Posted December 20, 2003 I need some help with my Thing_Spawn command. Right now I haveThing_Spawn (13, T_IMP, 0, random(651, 657); but the random tag isn't working. I know this because when I removed the random command and put in 657, my Color Translation was working. What am I doing wrong. I need to know how to generate a random tag between 651 and 657 so I can get my imp army looking proper. 0 Share this post Link to post
Fletcher` Posted December 20, 2003 Why not try using a variable instead? 0 Share this post Link to post
boris Posted December 20, 2003 cyber-menace said:I need some help with my Thing_Spawn command. Right now I haveThing_Spawn (13, T_IMP, 0, random(651, 657); but the random tag isn't working. I know this because when I removed the random command and put in 657, my Color Translation was working. What am I doing wrong. I need to know how to generate a random tag between 651 and 657 so I can get my imp army looking proper. Maybe you should try Thing_Spawn (13, T_IMP, 0, random(651, 657)); 0 Share this post Link to post
cyber-menace Posted December 20, 2003 Lol, yeah I DO have it like that. My script editor would have shouted at me otherwise. I'll try Cyb's idea. 0 Share this post Link to post
cyber-menace Posted December 20, 2003 Well this bugs me, I can't do it. It's not logically possible. There are about 400 requests all on the same line so it is only going to choose one number whether I like it or not. I guess I'll have to make more MapSpots... 0 Share this post Link to post
The Ultimate DooMer Posted December 21, 2003 The random function only works for values 0 to 255, so that's why it's not working. Use lower tag numbers, or do something complicated like this: script 1 (void) { int i = random (151, 157); i += 500; Thing_Spawn (13, T_IMP, 0, i); Do_OtherStuffHere } This will give a random tag from 151-157 but then adds 500 to it so it ends up being 651-657 when it gets in the spawn command. 0 Share this post Link to post
cyber-menace Posted December 21, 2003 Like I said it isn't possible. It has to vary between 400 or so different map spots, but since they are all spawned at the same time there is no way to switch the variable in mid spawn. Unless Zdoom has something really out of wack to do so. 0 Share this post Link to post
Graf Zahl Posted December 21, 2003 cyber-menace said:Like I said it isn't possible. It has to vary between 400 or so different map spots, but since they are all spawned at the same time there is no way to switch the variable in mid spawn. Unless Zdoom has something really out of wack to do so. Split the random calls. If you need 400 different numbers simply do: random(0,1)*200+random(0,199) This should generate a random number between 0 and 399. With this you should be able to get enough variation. 0 Share this post Link to post
cyber-menace Posted December 21, 2003 Graf Zahl said:Split the random calls. If you need 400 different numbers simply do: random(0,1)*200+random(0,199) This should generate a random number between 0 and 399. With this you should be able to get enough variation. Nooooooooo I have about 400 MAPSPOTS! with the tag 13, and they all ativate at the same time so I can only get one number, but I wanted about 5 or so, but I'm probably going to have to make more map spots for each number... 0 Share this post Link to post
The Ultimate DooMer Posted December 22, 2003 How about you divide 5 tags up between the 400 mapspots so you have 80 with each number. Then run this script 5 times: script 1 (int arg0) { int i = random (151, 157); i += 500; Thing_Spawn (arg0, T_IMP, 0, i); Do_OtherStuffHere } In the activation script put this line 5 times with no delays in between, and using one of the 5 tags as arg0 each time: ACS_ExecuteAlways (1, 0, arg0, 0, 0); This should give 5 sets of imps with one of the random 651-657 tags. And if you've distributed the 5 tags among the 400 mapspots well, then it'll look random too. 0 Share this post Link to post
cyber-menace Posted December 22, 2003 That's what I was going to do. I need more mapspots with different tags, because those mapspots were used for previous things as well. 0 Share this post Link to post