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

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
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

I think it would, one sound instead of.. At least 100 per second..

Another question..

This is quite pathetic that I don't know how to do this already..

I wanna make a unit turn on and off, off makes it use no metal, but makes it generate some energy. On makes it burn more metal to make more energy..

How would I do this? Could I put a check in the Cob to make sure I can have my extra effects enabled during this time?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Snipawolf wrote:I think it would, one sound instead of.. At least 100 per second..
32. Spring won't do anything faster than 32 times per game second.
I wanna make a unit turn on and off, off makes it use no metal, but makes it generate some energy. On makes it burn more metal to make more energy..

How would I do this? Could I put a check in the Cob to make sure I can have my extra effects enabled during this time?
Negative UseEnergy. I don't know if it'll keep producing energy when you're out of metal but I know you can't make the effect disable when the unit lacks the resources.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Yeah, I forgot to say I was using 2 Weapons, 1 slaved, to each Mgun, and it has 2 actual Mguns..

128.. 4 times the "limit"

It's meant to be turned on and off, so.. Is there any way cob could get that? Activation?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

get ACTIVATION returns 1 if the unit is on, 0 otherwise.

You'll probably be albe to dump the slaved MGs by using Projectiles=2 in 75b1, if my patch gets committed that is. I don't think you really need that many projectiles, though.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Well, I could make an effect for the bullet explosion that spawns several more dust clouds, making it look like 3 or 4 bullets hit instead of 1.. That could work..

Thanks for all the help..
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Snipawolf wrote:HHHHeeeeyyy...

If I use one long continuous, instead of making a sound everytime a bullet is fired in a burst, will it reduce lag?..
The less sounds played at the same time the better.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

rattle wrote:
Snipawolf wrote:HHHHeeeeyyy...

If I use one long continuous, instead of making a sound everytime a bullet is fired in a burst, will it reduce lag?..
The less sounds played at the same time the better.
do like I did, time the sound effect to a burst weapon. 1 sound is played for three shots every time a machine gun is fired in gundam(yellow machine gun)
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

I do do that... I just make a sound, and the faster it shoots, the higher pitched and faster I make the bullets..

Metal Storm.. 1 Million rounds per minute!!!

One sounds like a beep, the 1 Mill one sounds like a cannon xD

Ahh, why.. Why Why why!?

I know why.. Snipa still is a total newb... :lol: :|

It never works right, I studied other peoples, I can't get my units to build correctly..

Here is EVERYTHING relevant to my engy, who has a hard time building unless its at two buildtime...

Code: Select all

builder=1;
builddistance=100;
WorkerTime=100;

Code: Select all

#define SIG_ACTIVATE 2
#include "STANDARD_COMMANDS_GPL.h"

Activate()
{
	signal SIG_ACTIVATE;
	IsBuilding=1;
}
	
Deactivate()
{
	signal SIG_ACTIVATE;
	set-signal-mask SIG_ACTIVATE;
	IsBuilding=0;
	set-signal-mask 0;
}
BuildScript()
{
while(1)
{
		if(IsBuilding)
		{
			set INBUILDSTANCE to 1;
			sleep 500;
		}		
		while(!IsBuilding)
		{
			set INBUILDSTANCE to 0;
			sleep 500;
		}
}
}

Create()
{
Start-Script BuildScript();
}
That's all.. I think, if not, then I'm doin it wrong...

Edit: Another question, does anybody know offhand how the planes burning and crashing to the ground works? I would like to know...
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Revisiting the question that started this thread..

The mex that doesn't extract it, yet only produces metal on a metal spot.. (It's a lot easier to balance when all maps give the same amount of metal, and sticks a lot closer to my idea)

How would I go about scripting that, how would I find a way to get if its on metal or not? Activation perhaps?

Then, how could I tell the unit to make more metal from the cob? O.o
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Post by yuritch »

You can (sort of) guess if the building is on a metal spot or not by using SetSpeed COB function. This is called by the engine and is used since OTA times to set the speed at which the top of the mex rotates. Take note that the top won't rotate if you place an OTA (and probably AA, BA etc.) mex on a place with no metal. So, you should check the value which is passed to that function and if its not 0, you have some metal under your building.

Code: Select all

static-var MexSpeed, bIsOnMetal;
SetSpeed(NewSpeed)
{
   MexSpeed=NewSpeed;
   if(MexSpeed>0)
   {
      bIsOnMetal=TRUE;
   } else
   {
      bIsOnMetal=FALSE;
   }
}
The only way that I know of to control the amount of metal produced is by using set ACTIVATION. For example, if you want to produce 60% of maximum, you can do it like this:

Code: Select all

ProductionControl()
{
   var i;
   i=1;
   while(TRUE)
   {
      ++i;
      if(i>10)
      {
          i=1;
      }
      if(i<7)
      {
          set ACTIVATION to 1;
      } else
      {
          set ACTIVATION to 0;
       }
      sleep 100;
   }
}
This way, the building is ON 60% of the time and so it produces 60% of its max metal output on average.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Also be careful, people will figure out how they can split a metal spot between as many mexes as possible so that all of them are above the threshold.
User avatar
theHive
Posts: 124
Joined: 13 May 2007, 06:54

Post by theHive »

KDR_11k wrote:Also be careful, people will figure out how they can split a metal spot between as many mexes as possible so that all of them are above the threshold.
Not to mention non-TA style metal-maps, that'll get hectic :P
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Hehe, then fuck the metal spots..

I'll let people build wherever, that would still work, I'll just make space a resource...

I'll restore them back to their 10x10 size then :-)
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Oooh, Gundam style econ, eh?
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Well, might as well..

In my original idea for a game, you would fight over provinces and build resource producing facilities, but there would be a limit of 5. Which means you would need more provinces to feed your Wehrmacht.. Errm, War machine...

Learning German is fun :P
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Well, now I encounter a problem.

I found out the script for me engineer wasn't workin, so he wasn't getting set inbuildstance.

Now he is, but now I have to right click after I tell him to build or else he doesn't build as fast as he is supposed to...

I wonder why this is...
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Terraforming?
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

I don't think its terraforming... I'll check if removing levelground=1 makes a diff though...

Edit: Nope, no change... :|
Archangel of Death
Posts: 854
Joined: 28 Jan 2005, 18:15

Post by Archangel of Death »

Removing or setting to 0? The default value is probably 1. Just saying because its one of those little things someone might not think of sometimes.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Huhmm

Lemme check if setting to 0 works, then...


Ohh.. Damnit, it does work like that..

I thought all the tags were supposed to default to 0 unless they were floats...

Thanks for the help :mrgreen:
Locked

Return to “Game Development Tutorials & Resources”