Mod Question Repository... Questions come in, answers go out - Page 27

Mod Question Repository... Questions come in, answers go out

Resources to get you going on your new project, or to help you over some emergent problems during your development cycle.

Moderator: Moderators

Locked
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Mod Question Repository... Questions come in, answers go out

Post by Evil4Zerggin »

What is the difference between call-script and start-script, exactly? Does call-script wait for the function to return before continuing and start-script not?
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Re: Mod Question Repository... Questions come in, answers go out

Post by Peet »

Evil4Zerggin wrote:What is the difference between call-script and start-script, exactly? Does call-script wait for the function to return before continuing and start-script not?
Precisely.
Archangel of Death
Posts: 854
Joined: 28 Jan 2005, 18:15

Re: Mod Question Repository... Questions come in, answers go out

Post by Archangel of Death »

Except when calling lua dummy scripts. You can only use call-script with those, but it doesn't wait for them to return (or maybe returns them something like a boolean, but definitely not anything from the lua code).
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Mod Question Repository... Questions come in, answers go out

Post by KDR_11k »

Erm, lua scripts put their return values into LUA1-LUA9.
Archangel of Death
Posts: 854
Joined: 28 Jan 2005, 18:15

Re: Mod Question Repository... Questions come in, answers go out

Post by Archangel of Death »

And then you get LUA#... yah... my point was just that you shouldn't expect call-script to work on lua callouts the same as it does with normal cob functions.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Mod Question Repository... Questions come in, answers go out

Post by KDR_11k »

Well it does work the same way, the function executes and finishes before COB execution resumes.
[Krogoth86]
Posts: 1176
Joined: 23 Aug 2007, 19:46

Re: Mod Question Repository... Questions come in, answers go out

Post by [Krogoth86] »

I've got some questions again:

1.)
I want a construction unit to turn towards the direction he has to build. He doesn't have a rotatable turret or something but emits the particles from the end of this "arms" which can only be turned for lets say 45° because more looks silly / is just wrong. Is there something like weaponmaindir and its maxangledif for nanospraying too so that the unit has to turn itself?

2.)
This is about particles / FX. I want to spawn particles that - well move like they would be inside of a cone. Maybe two rough sketches of what I want:
"Front" View:
Image

"Side" View:
Image

I want so spawn the particles on that circular plane A which then should move towards the point B and thus form a "cone" which indicates in which area the particles could move. I now have some problems with this as I'd like to have this on a random basis if possible i.e. the particles are spawned randomly on that circular plane, somehow get the right vector which points towards point B and start moving...

I created the projectiles.txt and to my mind only CSimpleParticleSystem or CSphereParticleSpawner (as I wouldn't mind the circular emitting plane being a spherical volume) would be good for this. The problem now is that gravity only gives me attraction towards the three planes rather than a point so it has to be done via an directional emit vector. But as this isn't going to be a weapon but just an effect that starts via script I don't know how you could pass over the direction each particle has to go to...

3.)
A compromise of what I described in 2.): If I cannot achieve that effect I'd also be satisfied by spawning a "ring of particles" that moves towards point B (probably via gravity) but starts decreasing its radius while approaching. Is that possible?

4.)
You cannot create different types of "cruise missiles", can you? To give an example for this think of Supreme Commander. There you have those tactical missiles which get shot down by the tactical defenses and you have Nukes which get countered by Anti-Nukes. I looked for something like a numerical value or a "binary equivalent" like with the shields (which would be cool) but it seems there is just one cruise missile class...

5.)
I'd still appreciate if you could help me finding maps where the ground matches those of the AA buildpics. I found Small Divide probably being the background for the Arm buildpics and Mars could be the background for the Core images. Now I still need a map with a "deep blue sea and sky" - can you help me with that?

Thx in advance! :-)
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Mod Question Repository... Questions come in, answers go out

Post by KDR_11k »

1. Just use set HEADING to turn the unit towards the construction.
2. If you want to do it from a unit you can just make two pieces, one in the center and one at the edge of the circle witht he edge piece pointing towards the focus and the center piece rotating randomly. If you want to do it with pure CEGs you're going to need some of the new arcane magic tags. Look into the Fibre explo_doomsday CEG for an example, that has an expanding ring of particle emitters that are directed away from the center, would be trivial to turn them around.
3. AFAIK no, you could try using a ring painted on a muzzle flare tho, the Fibre transmitter has expanding rings, might be possible to turn that expansion around.
4. Yep, the antinuke system is pretty crappy. You could implement a cruise missile as a kamikaze plane like it's done for the terminal in Kernel Panic Div0, planes can be shot down with any weapon allowed to target them.

EDIT: The specific lines from explo_doomsday:

Code: Select all

			pos=d8 y0 i.1 s1 x0,0,1.5808 i.1 s1 x0;
			emitVector=i.1 s1,.8,1.5808 i.1 s1;
[Krogoth86]
Posts: 1176
Joined: 23 Aug 2007, 19:46

Re: Mod Question Repository... Questions come in, answers go out

Post by [Krogoth86] »

@KDR_11k:
Well thanks at first! :-)
1. Just use set HEADING to turn the unit towards the construction.
Could you please explain as to where and how exactly to put this line? In addition to that does this command just "turn" the unit or does it really create sort of a move order so that walking animation etc. automatically works?
2. If you want to do it from a unit you can just make two pieces, one in the center and one at the edge of the circle witht he edge piece pointing towards the focus and the center piece rotating randomly.
Yeah - this is what was my "emergency plan". Would have been nice to have the spawning on a completely random basis. Well I'm now going to create some spawning point and let them rotate like you said. Then I'll create some random vars in script to decide from which point the next particle should be spawned. Should do the trick... :wink:
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Mod Question Repository... Questions come in, answers go out

Post by KDR_11k »

You can just do turn piece to z-axis rand(0,<360>) now; to get a random rotation.

As for the set HEADING, nope, it just forcefully turns the unit. IIRC Kernel Panic Div0 has the trojan turning with a set HEADING call.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Mod Question Repository... Questions come in, answers go out

Post by Pxtl »

So, here's a question: how does Spring's timescale compare to the OTA one for all the various parts? Caydr observed that Spring appeared slower than OTA - if you look at the stats, all the BA/AA units are about 1.4x faster than their OTA versions. However, the econ was not similarly adjusted - the workertimes and buildtimes are all their OTA values. Then there's the issue of how fast COBs are animated.

Anybody know? Is Spring across-the-board slower? Or are only certain components slower?
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Mod Question Repository... Questions come in, answers go out

Post by bobthedinosaur »

okay, if i want a transport that can load 4 units but instead of hides the puts them in 4 different spots on the transport, what would that look like?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Mod Question Repository... Questions come in, answers go out

Post by smoth »

starwars has that in one of it's transports. I suspect it uses a condition to decide on what piece the arm attaches the unit to.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Mod Question Repository... Questions come in, answers go out

Post by zwzsg »

bobthedinosaur wrote:okay, if i want a transport that can load 4 units but instead of hides the puts them in 4 different spots on the transport, what would that look like?
viewtopic.php?f=14&t=4707&p=72817&#p72817
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Mod Question Repository... Questions come in, answers go out

Post by bobthedinosaur »

ty, zwzsg!
new question on getting a turning unit's heading (for wheel steering ect). i used the formula from older turning ta units in spring and spring wasnt too happy with it. has any one messed with spring to make it work?
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Re: Mod Question Repository... Questions come in, answers go out

Post by yuritch »

Try this for unit's heading:

Code: Select all

static-var heading;
...
heading = get HEADING;
It's really that simple, and no need for complex math.
HEADING is 82 btw, in case your Scriptor lacks a modern get constant include.
Lots of old script tricks can now be done much easier by using new set/get constants.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Mod Question Repository... Questions come in, answers go out

Post by Pxtl »

I've been looking at the changelog and can't figure out if this is doable - for Hardcore Annihilation, I want to convert all the units into pure-cylindrical targetting. How I do this? How I mine for fish?
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Mod Question Repository... Questions come in, answers go out

Post by bobthedinosaur »

Okay, I'm getting really really frustrated with this. Spring will crash if I spawn the factory with certain units in it, and if I 'give' spawn them spring will debug message 'missing corpse' which is not correct at all. Has any one else ran into similar errors while modding and what is the usually problem there?
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Re: Mod Question Repository... Questions come in, answers go out

Post by Snipawolf »

How I mine for fish?
With a fishpick >_>
Locked

Return to “Game Development Tutorials & Resources”