View topic - Weapon Problems.



All times are UTC + 1 hour


Post new topic Reply to topic  [ 76 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject: Re: Weapon Problems.
PostPosted: 11 Aug 2011, 18:13 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
FLOZi wrote:
Well, for that you need, indeed, a proper unit script.

If you post up your mod as an sdz or sd7 I'm sure we can get you sorted. :-)

Noone ever listens when I ask :'(


Top
 Offline Profile  
 
 Post subject: Re: Weapon Problems.
PostPosted: 11 Aug 2011, 18:22 
User avatar

Joined: 10 Aug 2011, 19:35
Location: EVERYWHERE
Here is a link: http://www.filedropper.com/openmachines_1


I did upload one for you, smoth, if that's what you were talking about.


Top
 Offline Profile  
 
 Post subject: Re: Weapon Problems.
PostPosted: 11 Aug 2011, 20:28 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
forgott to say you have to define the piece also.
like in your .s3o file, the model pieces have names (strings) but the script uses piece numbers.
So you could do something like this:
Code:
function script.QueryWeapon1()
return 0
end

and just guess if you need to put 0, 1,2 or 3 to make it shot from the correct piece.
But that would be stupid of course.
Instead there is a way to convert piece names to numbers and store them in a variable, works like this:
Code:
piecer_number = piece "piece_name"
ie
Code:
popper = piece "popper"
function script.QueryWeapon1()
return popper
end



also needs some other stuff to make the unit fire correctly, see here:
http://tvo.github.com/spring/2010/04/19/lus-stumpy.html
http://springrts.com/wiki/Animation-LuaScripting
http://springrts.com/wiki/SpringTutorialGame -> scripts\ folder for examples


Top
 Offline Profile  
 
 Post subject: Re: Weapon Problems.
PostPosted: 11 Aug 2011, 20:41 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
weaponType=[[Rifle]],

just see this now.
I found the rifle weapon type to be pretty fail.
use "Cannon" or something.


Top
 Offline Profile  
 
 Post subject: Re: Weapon Problems.
PostPosted: 11 Aug 2011, 21:01 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
Isn't rifle a hit cast? What's bad aboot it eh?


Top
 Offline Profile  
 
 Post subject: Re: Weapon Problems.
PostPosted: 11 Aug 2011, 21:29 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
smoth wrote:
Isn't rifle a hit cast? What's bad aboot it eh?
cast to what?
ie the appearently hardcoded default effects are bad imo
https://github.com/spring/spring/blob/master/rts/Sim/Weapons/Rifle.cpp
--------
-scaled up scout.s3o by factor 6 so you can actually see it
-added a alpha channel to scout.tga so you get black wheels but a colored body (teamcolor_tempfile.bmp is just a temp file i used but maybe helpful to look at.)
-fixed origins of ie wheels so they rotate around their center
-made a scoutscript.lua that shouts, spins wheels, explodes
-tried to made a scout2 that only shoots forward but did not manage right now. it is def. possible though.
-made unit/target categories so, that untis can shot each other

the effects from the weapon are strange rectangles instead of looking nice. iirc it is because you need to include or link to some textures.

you still need a armordefs.lua to make weapons deal correct damage

:arrow: http://www.file-upload.net/download-3655168/OpenMachines.sdd.zip.html

Image

good luck ;)
last try to make a Machines game did not get very far sadly.
viewtopic.php?f=14&t=24598&hilit=machines


Top
 Offline Profile  
 
 Post subject: Re: Weapon Problems.
PostPosted: 11 Aug 2011, 21:34 
Moderator
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
smoth wrote:
Isn't rifle a hit cast? What's bad aboot it eh?


It wouldn't surprise me if some of the issues regarding correct 'turn to face target for non turret weapons' behaviour went away with a more regularly used weapontype.


Top
 Offline Profile  
 
 Post subject: Re: Weapon Problems.
PostPosted: 11 Aug 2011, 21:36 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
to get correct effects:
viewtopic.php?f=14&t=25843


Top
 Offline Profile  
 
 Post subject: Re: Weapon Problems.
PostPosted: 11 Aug 2011, 23:20 
User avatar

Joined: 10 Aug 2011, 19:35
Location: EVERYWHERE
Thanks a lot, knorke. The reason I had rifle on is because it is an instant hit. I read that it's bad, but the original scout had an instant hit. Wasn't quite sure on changing this part or not.

Anyway, I'm going to be adding in the factory next. With building units from factories, do you pick a piece of the model for it to spawn at in the script? Just like choosing which model part shoots?

And one more thing, the cannon archs. I change that by switching the trajectory, I take it?


Top
 Offline Profile  
 
 Post subject: Re: Weapon Problems.
PostPosted: 12 Aug 2011, 00:01 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
Quote:
With building units from factories, do you pick a piece of the model for it to spawn at in the script? Just like choosing which model part shoots?
yes.
for factories there is one function that returns the piece at which at the unit will be build. (can also move/spin that piece and the unit will follow, spinning only seems to work around y axis unless you use some tricks)
and a second funcion returns a piece where a nano particle is created.
dont know if that is needed actually.
see the wiki links or example game for more info.

instant hit weapons:
you could use a fast cannon projectile or a laser maybe.
or if it works for you, then use the rifle type.

Quote:
And one more thing, the cannon archs. I change that by switching the trajectory, I take it?
dont know from head what tags you have to change to make a flatter trajectory. maybe just higher weaponVelocity will work.
sadly there is no nice list of weapon related tags yet.


Top
 Offline Profile  
 
 Post subject: Re: Weapon Problems.
PostPosted: 12 Aug 2011, 00:12 
User avatar

Joined: 10 Aug 2011, 19:35
Location: EVERYWHERE
Quote:
for factories there is one function that returns the piece at which at the unit will be build. (can also move/spin that piece and the unit will follow, spinning only seems to work around y axis unless you use some tricks)
and a second funcion returns a piece where a nano particle is created.
dont know if that is needed actually.
see the wiki links or example game for more info.

I'll check the example game.


Quote:
sadly there is no nice list of weapon related tags yet.


http://springrts.com/wiki/Weapon_Variables
Is that one okay? Found it a while ago.


Top
 Offline Profile  
 
 Post subject: Re: Weapon Problems.
PostPosted: 12 Aug 2011, 00:21 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
Machinesrocks wrote:
Quote:
http://springrts.com/wiki/Weapon_Variables
Is that one okay? Found it a while ago.
yes that is best one i think.
its not perfect or 100% reliable though.


Top
 Offline Profile  
 
 Post subject: Re: Weapon Problems.
PostPosted: 12 Aug 2011, 06:33 
User avatar

Joined: 10 Aug 2011, 19:35
Location: EVERYWHERE
...one more problem :? . Probably my (almost) last problem with units, since I still never got a building working properly. Spring refuses to recognize my building. My code inside of the units folder:
Code:
local unitName = "lightinfantryfactory"

local unitDef = {
 
  --Internal settings
    name = "Light Infantry Factory",
   objectName = "liteinfantryfactory.s3o",
   BuildPic = "filename.bmp",
    Category = [[TANK SMALL NOTAIR NOTSUB]],
    Side = "TANKS",
    TEDClass = "TANK",
    UnitName = "lightinfantryfactory",
    script = "lifscript.lua",
   
--Unit limitations and properties
    BuildTime = 100,
    Description = "Builds light machines.",
    MaxDamage = 0,
    RadarDistance = 0,
    SightDistance = 400,
    SoundCategory = "TANK",
    Upright = 0,
   buildoptions                  = {
     [[tank]],
  },

   
--Energy and metal related
    BuildCostEnergy = 0,
    BuildCostMetal = 75,
   
--Pathfinding and related
    Acceleration = 0,
    BrakeRate = 0,
    FootprintX = 2,
    FootprintZ = 2,
    MaxSlope = 15,
    MaxVelocity = 0,
    MaxWaterDepth = 0,
    MovementClass = "Default2x2",
    TurnRate = 0,
   
--Abilities
    Builder = 0,
    CanAttack = 0,
    CanGuard = 0,
    CanMove = 0,
    CanPatrol = 0,
    CanStop = 0,
    LeaveTracks = 0,
    Reclaimable = 1,

--Hitbox
--    collisionVolumeOffsets    =  "0 0 0",
--    collisionVolumeScales     =  "10 10 10",
--    collisionVolumeTest       =  1,
--    collisionVolumeType       =  "10 10 10",
   
--Weapons and related
    BadTargetCategory = "NOTAIR",
    ExplodeAs = "TANKDEATH",
    NoChaseCategory = "AIR", 
}

return lowerkeys({ [unitName] = unitDef })


The code within the scripts folder:
Code:
local main, pad, = piece "main", piece "pad",

function script.Create(unitID)
    return 0
end

function script.QueryBuildInfo() return pad end


And here is the download in case you need to see the model or placements: http://www.filedropper.com/openmachines_2

Sorry about all the problems, first time with a spring game, and no tutorial has properly discussed any of these problems. Not one that I know of at least. Thanks again. =P


Top
 Offline Profile  
 
 Post subject: Re: Weapon Problems.
PostPosted: 12 Aug 2011, 06:44 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
what is the error? (infolog.txt)
anyway, this is a working factory/building:

http://code.google.com/p/springtutorialgame/source/browse/trunk/SpringTutorialGame.sdd/Units/simplefactory.lua
and that is its script:
http://code.google.com/p/springtutorialgame/source/browse/trunk/SpringTutorialGame.sdd/Scripts/simplefactory.lua

Difference between (mobile) unit and building is mainly that buildings have a yardmap. (the grid footprint thing you see when placing it)

YardMap ="ooooo occco occco occco occco",
:arrow: read like this:
ooooo
occco
occco
occco
occco

o = "wall"
c ="open/closes when factory builds something"
so this factory has a U-shaped footprint.

Also buildings have no MovementClass because well, they do not move.
Oh, and needs Builder = true, instead of Builder = 0, for a factory.
And a buildoptions list what the builder can build.

just use the linked file and replace the names for unit/.s3o file/script etc


Top
 Offline Profile  
 
 Post subject: Re: Weapon Problems.
PostPosted: 12 Aug 2011, 11:43 
Modeler
User avatar

Joined: 15 Dec 2008, 15:53
Location: at front, llt pushing
http://terminus.pl/~seba/machines.jpg (not all visible on this pic)

i might send u obj file soon, if i dont forget, what might mean even week lol.

anyway, i dont have that much time now, only few are 'finished' (only 3dmesh) about rest... my terrible creativity failed even more than usually.

if u provide some images/blueprints, i might do something (point was i didnt want to copy-paste old models, u can do it urself tbh)


Top
 Offline Profile  
 
 Post subject: Re: Weapon Problems.
PostPosted: 12 Aug 2011, 16:23 
User avatar

Joined: 10 Aug 2011, 19:35
Location: EVERYWHERE
Wombat wrote:
http://terminus.pl/~seba/machines.jpg (not all visible on this pic)

i might send u obj file soon, if i dont forget, what might mean even week lol.

anyway, i dont have that much time now, only few are 'finished' (only 3dmesh) about rest... my terrible creativity failed even more than usually.

if u provide some images/blueprints, i might do something (point was i didnt want to copy-paste old models, u can do it urself tbh)


You're sebak on wiredforwar.org, aren't you? I've seen your models. Anyway, I have a dev team, I don't need any .obj's. =P

@Knorke: http://www.filedropper.com/infolog


Top
 Offline Profile  
 
 Post subject: Re: Weapon Problems.
PostPosted: 12 Aug 2011, 17:18 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
Quote:
wiredforwar.org
omg that page :shock:
sorry to say but do not have good memories of that. I LOVED Machines and found that site when searching for patch/crack/cd image some years ago, so mp games would be easier to set up.
well, it said you needed X amount of postings to acess the downloads so I did not even bother with registering and looked elsewhere. Still pissed me off massively at the time.
By then there were already threads about making "Machines 2"
It seems the only stuff that happend since then is lots of dream postings and maybe some 3d models.
No offense, but unless there is some secret site nobody in that forum did anything for 5 years. What kind of "team" is that?
Someone seriously proposed to use "the Steam Engine" while others ask if there are "Visual C++ programmers" around. "Or maybe dark basic should be used?" Sadly one guy could not help because his excel does not work. Oo

I can tell this is fail from having seen quite some fail in my time and often contributing to it.

Anyway, do not get disattracted with all that, as you see it produced little results in the last years. Concentrate on learning scripting, modeling and try to get 3,4 working units ingame.
Then, if multiple people start to contribute content (not ideas), set up an SVN.
-----------
from that infolog:
Quote:
[f=0000000] Loading unit script: scripts/lifscript.lua
[f=0000000] Failed to load: lifscript.lua ([string "scripts/lifscript.lua"]:1: '<name>' expected near '=')
some synthax error in the factory script in line 1. might look at it later but maybe you can figure it out yourself too.

Quote:
[f=0000000] [CCEG::Load] WARNING: table for CEG "redsmoke" invalid (parse errors?)
remove the redsmoke effect tag thing from the unitdef. not sure if missing effects stop the unit from being loaded but worth a try.


Top
 Offline Profile  
 
 Post subject: Re: Weapon Problems.
PostPosted: 12 Aug 2011, 17:24 
User avatar

Joined: 10 Aug 2011, 19:35
Location: EVERYWHERE
This isn't Machines 2. It's a remake. Those posts are very old. The guy with no excel was me, and the grow plan wasn't a grow plan for the game. Anyway, It's a separate project and we started on like august 6th. If you see a random guy with 1 post randomly suggesting an engine, it's not our team.


I have libre office anyway. The forums do look like a joke now, but we do have a team.

EDIT: There is also a development tab on the first page that showed some early progress on this engine. We're mainly using an irc.


Top
 Offline Profile  
 
 Post subject: Re: Weapon Problems.
PostPosted: 12 Aug 2011, 17:28 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
Machinesrocks wrote:
Wombat wrote:
http://terminus.pl/~seba/machines.jpg (not all visible on this pic)

i might send u obj file soon, if i dont forget, what might mean even week lol.

anyway, i dont have that much time now, only few are 'finished' (only 3dmesh) about rest... my terrible creativity failed even more than usually.

if u provide some images/blueprints, i might do something (point was i didnt want to copy-paste old models, u can do it urself tbh)


You're sebak on wiredforwar.org, aren't you? I've seen your models. Anyway, I have a dev team, I don't need any .obj's. =P

@Knorke: http://www.filedropper.com/infolog

Protip brosef don't turn down free help because " you have a team," ever.


Top
 Offline Profile  
 
 Post subject: Re: Weapon Problems.
PostPosted: 12 Aug 2011, 17:33 
User avatar

Joined: 10 Aug 2011, 19:35
Location: EVERYWHERE
smoth wrote:
Machinesrocks wrote:
Wombat wrote:
http://terminus.pl/~seba/machines.jpg (not all visible on this pic)

i might send u obj file soon, if i dont forget, what might mean even week lol.

anyway, i dont have that much time now, only few are 'finished' (only 3dmesh) about rest... my terrible creativity failed even more than usually.

if u provide some images/blueprints, i might do something (point was i didnt want to copy-paste old models, u can do it urself tbh)


You're sebak on wiredforwar.org, aren't you? I've seen your models. Anyway, I have a dev team, I don't need any .obj's. =P

@Knorke: http://www.filedropper.com/infolog

Protip brosef don't turn down free help because " you have a team," ever.


I probably shouldn't, but the modellers right now make models that look similar to each other. If he wants to help with something else, he could, but I really don't need a modeller right now.

Also, If you need the machines discs, you can let me know. We have them working on xp, vista, and windows 7.


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 76 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.