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

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
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

What kind of question is that? You just make the function return the value 200, that means 200% damage.
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Post by bobthedinosaur »

so
HitByWeaponId(var1posZ,var2posX,id,damage)

var rando

if id == 30 // some weapon that does random damage
(
rando = (Rand( 1, 20 ))*10;
return damage rando; // dis does not make sense
)
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Return takes only one parameter.

return rando;
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Post by bobthedinosaur »

oh, thats what i was confused about, thanks kdr
hamsate
Posts: 122
Joined: 21 Jun 2007, 00:25

Post by hamsate »

Argh wrote:I'd suggest, frankly, to start with my "minimal unit" file from NanoBlobs 0.63..
I got the public release version 0.64. Anyways, I looked through some of the scripts for the units and that just confuses me. I only have slight experience with programming, so I can understand parts of it, but I just don't understand. This is probably the next hurdle I have to go through. Anyone supply a tutorial or reference about what all it's about?

Just throwing this question out there, a unit requires a script right?
Rubenes
Posts: 84
Joined: 27 Apr 2005, 14:28

Post by Rubenes »

hamsate wrote:
Argh wrote:I'd suggest, frankly, to start with my "minimal unit" file from NanoBlobs 0.63..
I got the public release version 0.64. Anyways, I looked through some of the scripts for the units and that just confuses me. I only have slight experience with programming, so I can understand parts of it, but I just don't understand. This is probably the next hurdle I have to go through. Anyone supply a tutorial or reference about what all it's about?

Just throwing this question out there, a unit requires a script right?
Every unit requires a script, but you can make scripts which do absolutely nothing.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Note that every script must contain at least one function (even if it's a made-up one) and every function must contain at least one command (even if it's just a return 0 or sleep 1), otherwise Scriptor will screw up.
[Krogoth86]
Posts: 1176
Joined: 23 Aug 2007, 19:46

Post by [Krogoth86] »

Is it possible to have a unit in multiple classes inside the Armor.txt i.e. the Arm Triton for example could be inside a L2Tank and another Amphibious class? Or does this give some errors / conflicts?
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Post by Peet »

Nope, multiple armour classes make no logical sense and thus do not work.
[Krogoth86]
Posts: 1176
Joined: 23 Aug 2007, 19:46

Post by [Krogoth86] »

Damn - I had hoped that this might work as long as you don't create a group for just a single unit (which has the unit's name) as it's said in the wiki. Something like that would have been nifty...
User avatar
KingRaptor
Zero-K Developer
Posts: 838
Joined: 14 Mar 2007, 03:44

Post by KingRaptor »

If a unit has multiple armorclasses it probably just uses the first one in the file or the last one in alphabetical order, not sure which.
User avatar
kiki
Posts: 859
Joined: 05 Nov 2007, 03:06

Post by kiki »

Peet wrote:Nope, multiple armour classes make no logical sense and thus do not work.
ditto
[Krogoth86]
Posts: 1176
Joined: 23 Aug 2007, 19:46

Post by [Krogoth86] »

lbctech wrote:ditto
Well to my mind this perfectly makes sense as you don't really give one unit an armor class (though this is what's done via the engine) but you define damage groups. If you could define groups rather than have to give every unit just one entry you could ease and clean up the process of damage groups for your weapon entries. For example if you want a fake explosion you put the default value high and add an "ALL" damage group which contains all your units so you don't have to list every category you created. This way you could have several groups like "GROUND", "AIR", "BOATS", "SUBS" and on and on. This makes the weapons code much more clean and easy and it's way faster if you would want to change a damage value (as you now have to change it for all other similar groups too). This is just a "cosmetic" nicety of course but I'd be glad to have this...

This gets more annoying if you want a more complex damage behaviour between your units and so you end up with a lot of groups which isn't very nice...
hamsate
Posts: 122
Joined: 21 Jun 2007, 00:25

Post by hamsate »

Rubenes wrote:Every unit requires a script, but you can make scripts which do absolutely nothing.
And so a unit without script won't have animations, correct? It will still be able to just move around? Or does the script have a part in that, too?
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Post by SinbadEV »

default behavior for the suggested "minimal script" would be to slide along the ground, turn in the direction it needs to shoot and shoot from it's base (I think) or something... basically it will show up and move around enough to know you have the texture and scale right.
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Post by Pressure Line »

hamsate wrote:
Rubenes wrote:Every unit requires a script, but you can make scripts which do absolutely nothing.
And so a unit without script won't have animations, correct? It will still be able to just move around? Or does the script have a part in that, too?
it will move around (or not) as defined by the unit.fbi file. iirc the BA adv solars have a more or less blank script.

there is a program called 'lazyscripter' that will generate a template script for you from a 3do model, find, download and use if you really cannot be bothered doing a script. but tbh, unless you are actually going to write a proper script you may as well not bother.
User avatar
kiki
Posts: 859
Joined: 05 Nov 2007, 03:06

Post by kiki »

+1 for damage groups. But armor class is different is all I was saying.
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Post by bobthedinosaur »

best resource for scripts is other ones already made, and cut and paste
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

BOB! :D

and yes bob speak truths.

First cut and paste
Then small bits here and there
Then you know enough to build small script on your own
And then with more practice, build large scripts on your own.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

I used that TA Design guide. It's not perfect though.
Locked

Return to “Game Development Tutorials & Resources”