Page 1 of 1

A_CustomMissile -- Offset_XY Problem

Posted: Fri Jun 29, 2007 17:28
by KeksDose
I have a problem with my sandstorm. I want it to spawn the "SandStorm" Actor in a random Offset X/Y between 0 and 256, and a random height between 0 and 256. But it doesn't seem to spawn them in the correct X/Y Offset, so it only spawns them in a random Z position.

This is how they're spawned:
Image


And here is the "Sandstorm Generator" and the "SandStorm-Projectile" Code:
[spoiler]

Code: Select all

Actor SandStorm 10080 //Sandstorm Generator
{
 +NoGravity
 Height 1
 Radius 1
 States
 {
  Spawn:
   TNT1 A 1 A_CustomMissile("SandStorm_A", Random(0, 256), Random(-128, 128), 0, 2, 0)
   Loop
 }
}

Actor SandStorm_A //Projectile
{
 +NoGravity
 +Missile
 +NoTeleport
 Radius 2
 Height 2
 Alpha 1
 Scale 2.0
 States
 {
  Spawn:
   TNT1 A 0
   TNT1 A 0 ThrustThing(0, Random(2, 12), 0, 0)
   SAND Z 3 A_SetTranslucent(0.97, 1)
   SAND Y 3 A_SetTranslucent(0.94, 1)
   SAND X 3 A_SetTranslucent(0.91, 1)
   SAND W 3 A_SetTranslucent(0.88, 1)
   SAND V 3 A_SetTranslucent(0.85, 1)
   SAND U 3 A_SetTranslucent(0.82, 1)
   SAND T 3 A_SetTranslucent(0.79, 1)
   SAND S 3 A_SetTranslucent(0.76, 1)
   SAND R 3 A_SetTranslucent(0.73, 1)
   SAND Q 3 A_SetTranslucent(0.70, 1)
   SAND P 3 A_SetTranslucent(0.67, 1)
   SAND O 3 A_SetTranslucent(0.64, 1)
   SAND N 3 A_SetTranslucent(0.61, 1)
   SAND M 3 A_SetTranslucent(0.58, 1)
   SAND L 3 A_SetTranslucent(0.55, 1)
   SAND K 3 A_SetTranslucent(0.52, 1)
   SAND J 3 A_SetTranslucent(0.49, 1)
   SAND I 3 A_SetTranslucent(0.46, 1)
   SAND H 3 A_SetTranslucent(0.43, 1)
   SAND G 3 A_SetTranslucent(0.40, 1)
   SAND F 3 A_SetTranslucent(0.37, 1)
   SAND E 3 A_SetTranslucent(0.34, 1)
   SAND D 3 A_SetTranslucent(0.31, 1)
   SAND C 3 A_SetTranslucent(0.28, 1)
   SAND B 3 A_SetTranslucent(0.25, 1)
   SAND A 3 A_SetTranslucent(0.22, 1)
   SAND A 3 A_SetTranslucent(0.19, 1)
   SAND A 3 A_SetTranslucent(0.16, 1)
   SAND A 3 A_SetTranslucent(0.13, 1)
   SAND A 3 A_SetTranslucent(0.10, 1)
   SAND A 3 A_SetTranslucent(0.07, 1)
   SAND A 3 A_SetTranslucent(0.04, 1)
   SAND A 3 A_SetTranslucent(0.01, 1)
   Stop
 }
}
[/spoiler]

Posted: Fri Jun 29, 2007 18:09
by Logan MTM
Nice shot dude, NICE shot!

Try this:
{
Spawn:
TNT1 A 1 A_CustomMissile("SandStorm_A", 0 + Random (0, 256), 0 + Random(-128, 128), 0, 2, 0)
Loop
}

Posted: Fri Jun 29, 2007 18:15
by KeksDose
Grrrrr, still no luck. *Mutates to HULK, grabs his PC and throws it out of the window and jumps on it with a bodyslam*

Posted: Fri Jun 29, 2007 18:20
by Logan MTM
Hmmm...
I'm not sure but, i think A_CustomMissile is for MONSTERS only! I donno well.

Posted: Fri Jun 29, 2007 18:21
by KeksDose
I tried making it a monster, but my problem is actually that it only spawns the Sandstorm Projectile vertically, not horizontally.

[Edit] AHHHH! I've got it working now. I looked up for A_CustomMissile in the Wiki, but A_CustomMissile seems to ignore Offset_XY for me, so I tried using A_SpawnItem, but this hasn't got so much functions, and THEN I found A_SpawnItemEx, and now it FINALLY works :thumb: Now I can get a new computer! :happy:

Posted: Fri Jul 13, 2007 6:23
by Logan MTM
KeksDose wrote:...Now I can get a new computer! :happy:
I didn't understood this part! |o|

Posted: Fri Jul 13, 2007 9:52
by KeksDose
I wrote: *Mutates to HULK, grabs his PC and throws it out of the window and jumps on it with a bodyslam*
I wrote: ...Now I can get a new PC :happy: