[Discussion] Generic X3TC S&M questions II
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 9378
- Joined: Mon, 29. Dec 08, 20:58
-
- Posts: 13244
- Joined: Fri, 13. Jan 06, 16:39
Both. You cannot change these values independantly.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
-
- Posts: 9378
- Joined: Mon, 29. Dec 08, 20:58
-
- Posts: 9378
- Joined: Mon, 29. Dec 08, 20:58
Just stumbled across a common sense problem for the random asteroid script...
4 Booleans, do you want Ore, Ice, Sil, Niv...
Problem is, the asteroids are set to have a random subtype between 0 and 3, with it being 0 for ore, 1 silicon, 2 niv and 3 for ice...
How would I set it up so any combination would work!?
I need to basically say, random number out of any of these 4 marked as true, and I'm having a mental blank... is there any way to put the 4 numbers in an array then tell it to grab a random value out of the array?
4 Booleans, do you want Ore, Ice, Sil, Niv...
Problem is, the asteroids are set to have a random subtype between 0 and 3, with it being 0 for ore, 1 silicon, 2 niv and 3 for ice...
How would I set it up so any combination would work!?
I need to basically say, random number out of any of these 4 marked as true, and I'm having a mental blank... is there any way to put the 4 numbers in an array then tell it to grab a random value out of the array?
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
-
- Posts: 1468
- Joined: Wed, 3. Aug 05, 05:05
Ejon,
$subtype.array = array alloc size = 0
skip if not $ore.ast.TF = [TRUE]
| append 0 to array $subtype.array
skip if not $sil.ast.TF = [TRUE]
| append 1 to array $subtype.array
skip if not $niv.ast.TF = [TRUE]
| append 2 to array $subtype.array
skip if not $ice.ast.TF = [TRUE]
| append 3 to array $subtype.array
$size = size of array $subtype.array
if $size > 0
| $rand = get random value between 0 and $size -1
| $rand.sub.type = $subtype.array [$rand]
| create asteriod: subtype $rand.sub.type .....
end
MarCon
$subtype.array = array alloc size = 0
skip if not $ore.ast.TF = [TRUE]
| append 0 to array $subtype.array
skip if not $sil.ast.TF = [TRUE]
| append 1 to array $subtype.array
skip if not $niv.ast.TF = [TRUE]
| append 2 to array $subtype.array
skip if not $ice.ast.TF = [TRUE]
| append 3 to array $subtype.array
$size = size of array $subtype.array
if $size > 0
| $rand = get random value between 0 and $size -1
| $rand.sub.type = $subtype.array [$rand]
| create asteriod: subtype $rand.sub.type .....
end
MarCon
-
- Posts: 9378
- Joined: Mon, 29. Dec 08, 20:58
-
- Posts: 9378
- Joined: Mon, 29. Dec 08, 20:58
-
- Moderator (Script&Mod)
- Posts: 14571
- Joined: Sun, 20. Nov 05, 22:45
get the Ressource Type and the Yield, destroy the Asteroid and create Debris with the same Mineral and Yield on its position (or put in some random factor)
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help

-
- Posts: 9378
- Joined: Mon, 29. Dec 08, 20:58
-
- Posts: 22574
- Joined: Sat, 23. Apr 05, 21:42
Probably not quite, but almost.EmperorJon wrote:Is that how the game does it?
Remember that Asteroids do respawn. Therefore, "blow up" does not mean same as "destroy". I would implement "vanilla blow up" as:
1. Make invisible
2. Create debris
3. Start re-spawn timer
And therefore the respawn would be a simple:
1. Make visible (with "avoid in-sector collision")
-
- Posts: 9378
- Joined: Mon, 29. Dec 08, 20:58
Considering they're not vanilla asteroids, they are ones I've added, that's unecessary.
The problem at the moment is, upon me saying 'destroy' they, obviously, break apart into the debris, then the debris disappears, but I can't find any way of actually creating the right sized debris in the right place by the right rotation... what could I do?
The problem at the moment is, upon me saying 'destroy' they, obviously, break apart into the debris, then the debris disappears, but I can't find any way of actually creating the right sized debris in the right place by the right rotation... what could I do?
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
-
- Moderator (Script&Mod)
- Posts: 14571
- Joined: Sun, 20. Nov 05, 22:45
that is not necesary because this will be done by the Game Engine - you have to tell it specificallty that it mustn't respawn an Asteroid before you destroy it.. (can be done with "disable Ship" )jlehtone wrote:Remember that Asteroids do respawn. Therefore, "blow up" does not mean same as "destroy". I would implement "vanilla blow up" as:
1. Make invisible
2. Create debris
3. Start re-spawn timer
And therefore the respawn would be a simple:
1. Make visible (with "avoid in-sector collision")
@EJ no idea, but since the Destruction Animation of the big Asteroid is iirc always the same create one in the Sector center, destroy it and save the Coordinates of some debris until you have them all, then you just need some trigonometry to calculate the debris position for every Position and Angle in the Sector
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help

-
- Posts: 9378
- Joined: Mon, 29. Dec 08, 20:58
-
- Posts: 2033
- Joined: Wed, 29. Jun 05, 01:45
The rgb values in the tfiles are just (correct me if I'm wrong) the emissive light source values of the bullet, not the actual diffuse texture.
The actual "colour" of the bullet, is defined by it's model/texture (and most projectiles tend to use just the one "star" texture, repeated several times, so you should be able to modify that)
The actual "colour" of the bullet, is defined by it's model/texture (and most projectiles tend to use just the one "star" texture, repeated several times, so you should be able to modify that)
-
- Posts: 9378
- Joined: Mon, 29. Dec 08, 20:58
-
- Posts: 214
- Joined: Sat, 25. Mar 06, 13:19
-
- Posts: 9378
- Joined: Mon, 29. Dec 08, 20:58
Ah, ok...
Can anyone help me out on this one...
It's triggered by moving to a new sector... well, ok it isn't. Something else is triggered which then runs this, but anyway.
Causes blackness like it was still loading the sector, and station noises and announcements. Seems to be an infinite loop of some kind... but where!? It never reaches the show logfile output, whereas the others are reached, so this is the problem. If this is impossible for some reason, other ways?
EDIT: It would appear it's making it into the next script, which does have... a large loop in it. Very large.
Can anyone help me out on this one...
It's triggered by moving to a new sector... well, ok it isn't. Something else is triggered which then runs this, but anyway.
Code: Select all
001 while $Num
002 |dec $Num =
003 @ |= wait 5 ms
004 |display subtitle text: text= *This text has been removed to prevent spoilers* duration=2000 ms
005 @ |= [THIS] -> call script *This text has been removed to prevent spoilers*:
006 |write to log file #19283 append=[TRUE] value='It reached this part.'
007 end
008 return null
EDIT: It would appear it's making it into the next script, which does have... a large loop in it. Very large.

______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
-
- Posts: 1468
- Joined: Wed, 3. Aug 05, 05:05
EJon,
How long after the change sector is complete is the script called, cos you will need to wait to the change sector is comlete i think.
Is there something in this script that could be causing the loop? Without seeing the code for it we can't tell if it's in there.
How big is $Num ?
The way this will loop will only show the last subtitle as any previous ones will be overwritten due to the 5 ms wait if $Num is greater than 1.
MarCon
How long after the change sector is complete is the script called, cos you will need to wait to the change sector is comlete i think.
Code: Select all
005 @ |= [THIS] -> call script *This text has been removed to prevent spoilers*:
How big is $Num ?
Code: Select all
003 @ |= wait 5 ms
004 |display subtitle text: text= *This text has been removed to prevent spoilers* duration=2000 ms
MarCon