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

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
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 »

i know hoi. thank you, but thats not the problem.
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

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

Post by Hoi »

then maybe the fireplatform tag is bugged, transports dont give the stuff inside it dmg.
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

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

Post by Gnomre »

It doesn't have to be a fake building. You can give real structures transport capabilities.

Hoi, there's nothing wrong with isfireplatform, it's doing its job fine. Absorbing damage isn't in its job description. Either the hitsphere of the loaded unit is sticking out and being contacted before the bunker (so the bunker is actually being meatshielded) or it's just being hit by very high velocity weapon and/or weapons with large splash damage.

We've been working with this to, and from my tests it looks like bunkers still take full normal damage if the garrisoned unit is poking out and being hit. There are really two workarounds you could choose from:

1) Add the tag cobid=some integer; to the bunker's fbi.

2a) Make the garrisoned units invincible:
In the garrisonable unit scripts, add this:

Code: Select all

static-var inBunker;

HitByWeaponId(z,x,id,damage) {
	if(inBunker) { return 0; }
	if(!inBunker) { return 100; }
}

setSFXoccupy(level) {
	if(level == 0) { //now in a transport
		var transport, tid;
		tid = get TRANSPORT_ID;
		transport = get COB_ID(tid);
		if(transport == some integer) { //the cobid tag you entered earlier
			inBunker = 1;
		}
	}
	if(level != 0) { //anywhere else
		inBunker = 0;
	}
}
or 2b) "Bury" the garrisoned units:
In the bunker script, add this:

Code: Select all

Create() {
	move attachpiece1 to y-axis [negative value] now;
	move attachpiece2 etc
}
In the garrisonable unit scripts, add this:

Code: Select all

setSFXoccupy(level) {
	if(level == 0) { //now in a transport
		var transport, tid;
		tid = get TRANSPORT_ID;
		transport = get COB_ID(tid);
		if(transport == some integer) { //the cobid tag you entered earlier
			move model_root_object to y-axis [positive value] now;
		}
	}
	if(level != 0) { //anywhere else
		move model_root_object to y-axis [0] now;
	}
}
If you use 2b just make sure you set up AimFromWeapon*() and QueryWeapon*() correctly so they still end up in valid firing positions when you move the model around.
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 »

awesome gnome! the 1st one looks like what i need since it will have to shoot out of it and cant by under ground, but i think ill add a randomizer to the return tho so its not totally zero since its not a covered bunker, it should just be much harder to get a good shot in.
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

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

Post by Gnomre »

It'd still be able to fire if its hitsphere is underground. That's why I mentioned AimFromWeapon and QueryWeapon :P

But yeah if you want them to take some damage underground is obviously not the way to go.
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 »

who is this we?
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

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

Post by Das Bruce »

Can units path through 'unoccupied' squares set by yardmap?
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 »

yes
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

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

Post by Das Bruce »

Can lua tell if a unit is on a open yardmap square as opposed to empty ground and what type of unit said yardmap square belongs too?
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

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

Post by rattle »

COB<->Lua, the events are all there...
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 »

cant find the number to define transportid

EDIT: n/m
its in here
http://spring.clan-sy.com/wiki/Units:.bos/.COB

its 94

for some reason fire fox search doesnt like frenglish pages
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

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

Post by rattle »

You were missing an underscore
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 »

where would be the best place to put a falling detection in a bos for the drop unload type?

also going back to the bunker, part of the model goes under ground, but i guess digger=1 doesnt work in spring? is there any work around with this or should i give up and make a dark are for the underground piece?
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

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

Post by Gnomre »

If it's underground, it's underground, that's all there is to it, unless you wish to write a lua script which deforms the ground for you. That'd make it rather easy to scout though afaik.
bobthedinosaur wrote:where would be the best place to put a falling detection in a bos for the drop unload type?
http://spring.clan-sy.com/mantis/view.php?id=630
Added tags:
transportUnloadMethod = <integer>;
0 - land unload, 1 - flyover drop, 2 - land flood

fallSpeed = <float>
unitFallSpeed = <float>

These dictate the speed of units being dropped from the transport.
fallSpeed is used on the transports fbi file, to dictate the speed of all units it drops, unitFallSpeed is used on each transported unit to override fallSpeed.

Transport AI now calls the cob function:
'StartUnload'
which is called once when transport starts to lower during land flood method.

Dropped units call the cob functions:
'falling' and 'landed' so that you may start and stop a parachute animation.
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 »

crap on the deforming.
and:
well i meant for a unit that is falling, where would the best loop be in its script to check for falling? so you can add whatever animation/ fx
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 »

By the sound of it, you don't have to check for falling. Just add a falling() function and a landed() function in the script, have falling() start the animation/fx stuff, and landed() kill it. Its kinda like how move script stuff works.
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 »

strange...
now how about that mech critic damage assigning script? :P
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 »

on a different note:
what does holdtime do? cant find documentation, its in some bertha tdf/ lua weapon files.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

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

Post by FLOZi »

In OTA holdtime forced the weapon to wait for that time in ms once on target before firing. Afaik spring doesn't implement it, but i may be wrong, i've not checked.
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 »

hmm thats what i assumed it is, ill test it later.

another question. is there away where i can kill all the units qued up in factory line up or maybe just get the resources back like the cancel build option. i want to kill a factory with a timer but i dont want the resources wasted for units that are still being build due to over queing
Locked

Return to “Game Development Tutorials & Resources”