View unanswered posts | View active topics It is currently Sat Dec 28, 2024 1:56 am



Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
 Newbie scripting questions 
Author Message

Joined: Wed Dec 14, 2011 3:46 am
Posts: 20
Reply with quote
Post Newbie scripting questions
Yup, I seem to have a knack for getting stuck on what are probably very simple and basic things for everyone else here, but try and bear with me without too much eyerolling. Keep in mind that at any given time I have absolutely no clue what I'm currently doing.

Problem 1: What does MO stand for? MO money MO problems? Massive Octopus?
Problem 1a: What exactly is the difference between a MOpixel, a MOSParticle and a MOSRotating? I've tried switching out MOPixels for MOSparticles in the vanilla scripts to experiment but either nothing notable happens, or the game breaks, so I can't really tell.

Problem 2: The CC wiki defines AtomGroup as "Defines a group of collision Atoms for the MO. Much the same as Atom, but you have to define the density of the detecting atoms with Resolution and the depth from the edge of the sprite with Depth."
My problem here (other than not knowing what an MO is) Is how exactly I'm supposed to use this. Actually, Atoms in general. Doesn't setting the sharpness and mass of the projectile defeat the purpose of using an atom to determine the collision point between a MOPixel and a MOSParticle? And even then, what happens if you make a gun the shoots MOSParticles? Then you would need to define the collision point between a MOSParticle and another MOSParticle. What would you use for that?

Problem 3: What's the difference between TracerRound and RealRound? They both seem the same in the game.

That's about it. For now. Hopefully. I reeeeeeeally kind of regret not taking those computer programming courses in high school.

EDIT: One last question. What is a float scalar? That's the only thing I don't understand in the base.rte/materials.ini


Tue Dec 27, 2011 9:51 pm
Profile
User avatar

Joined: Sun Jan 28, 2007 10:32 pm
Posts: 1609
Location: UK
Reply with quote
Post Re: Newbie scripting questions
MO: Moving Object.

MOPixel: MOPixels are the smallest type of effect. They are one pixel, with one color, and some properties. Their singular and manually defined atom defines the material that the MOPixel is made of, as well as a trail effect. They fill a lot of roles, they can be used as sparks, blood, shrapnel, exhaust, bullets, the list goes on.
MOSParticle: "MOSParticles are quite simply MOPixels with an animated sprite. They can be gibs, but they cannot be gibbed."
MOSRotating: MOSRotatings are your basic gibs. They can be gibs and can be gibbed.

Atoms; no, see... Sharpness and Mass are just two characteristics of interaction. They each define one aspect of how things interact, not everything. Mass is mass. Sharpness is sharpness. Neither of these things define what might be called a "hitbox" or "collision mesh", which are the important bits. In most cases AtomGroups and DeepGroups are automatically calculated and you don't really need to worry about them at all.

Tracers; not every round in a machinegun is a tracer. What this mostly does is allow you to properly simulate the use of tracers, but you can be a bit more creative than that... for example, you could make a gun alternate between two different projectiles that have entirely different properties. The RTTRatio controls how often the TracerRound is fired instead of the RegularRound.

I forget who made this but the comments explain a lot about how bullets, rounds, magazines and guns work;
Attachment:
annotated pistol.ini [27.44 KiB]
Downloaded 224 times


Tue Dec 27, 2011 11:41 pm
Profile YIM

Joined: Wed Dec 14, 2011 3:46 am
Posts: 20
Reply with quote
Post Re: Newbie scripting questions
Arcalane wrote:
MO: Moving Object.

MOPixel: MOPixels are the smallest type of effect. They are one pixel, with one color, and some properties. Their singular and manually defined atom defines the material that the MOPixel is made of, as well as a trail effect. They fill a lot of roles, they can be used as sparks, blood, shrapnel, exhaust, bullets, the list goes on.
MOSParticle: "MOSParticles are quite simply MOPixels with an animated sprite. They can be gibs, but they cannot be gibbed."
MOSRotating: MOSRotatings are your basic gibs. They can be gibs and can be gibbed.

Atoms; no, see... Sharpness and Mass are just two characteristics of interaction. They each define one aspect of how things interact, not everything. Mass is mass. Sharpness is sharpness. Neither of these things define what might be called a "hitbox" or "collision mesh", which are the important bits. In most cases AtomGroups and DeepGroups are automatically calculated and you don't really need to worry about them at all.

Tracers; not every round in a machinegun is a tracer. What this mostly does is allow you to properly simulate the use of tracers, but you can be a bit more creative than that... for example, you could make a gun alternate between two different projectiles that have entirely different properties. The RTTRatio controls how often the TracerRound is fired instead of the RegularRound.

I forget who made this but the comments explain a lot about how bullets, rounds, magazines and guns work;
Attachment:
annotated pistol.ini



That clears up so much for me, can't thank you enough!

But to be sure, you're saying that Atoms and the AtomGroup/DeepGroup are basically defining a... The CC version of a hitbox, I guess you would call it, or do they define an objects interaction parameters with an Atom? I don't know if I'm making any sense here or if I'm just making my ignorance even clearer.


Wed Dec 28, 2011 8:41 am
Profile
User avatar

Joined: Sun Jan 28, 2007 10:32 pm
Posts: 1609
Location: UK
Reply with quote
Post Re: Newbie scripting questions
According to the List of Cortex Variables Defined;

AtomGroup - Defines a group of collision Atoms for the MO. Much the same as Atom, but you have to define the density of the detecting atoms with Resolution and the depth from the edge of the sprite with Depth.
DeepGroup - Same as AtomGroup, but for a different purpose. When a DeepGroup Atom touches terrain, it causes Cortex to clear the terrain the MO currently occupies.


Wed Dec 28, 2011 12:09 pm
Profile YIM
User avatar

Joined: Fri Feb 16, 2007 8:43 pm
Posts: 1695
Location: AH SHIT FUCK AUGH
Reply with quote
Post Re: Newbie scripting questions
In other words, AtomGroups collide with each other (and terrain), providing the collision detection of CC that we all know and love. They can also destroy terrain, though more realistically than DeepGroups, which DON'T collide with each other or AtomGroups, but rather - you guessed it - destroy terrain on contact.

You generally want DeepGroups to have a greater Depth than AtomGroups, because the former overrides the latter. This means that if your DeepGroup has equal or greater Depth (how many pixels of "outline" to ignore when determining collisions), then you won't get collisions with other objects, and your object will eat terrain for breakfast.


Wed Dec 28, 2011 2:58 pm
Profile WWW

Joined: Wed Dec 14, 2011 3:46 am
Posts: 20
Reply with quote
Post Re: Newbie scripting questions
Shook wrote:
In other words, AtomGroups collide with each other (and terrain), providing the collision detection of CC that we all know and love. They can also destroy terrain, though more realistically than DeepGroups, which DON'T collide with each other or AtomGroups, but rather - you guessed it - destroy terrain on contact.

You generally want DeepGroups to have a greater Depth than AtomGroups, because the former overrides the latter. This means that if your DeepGroup has equal or greater Depth (how many pixels of "outline" to ignore when determining collisions), then you won't get collisions with other objects, and your object will eat terrain for breakfast.


Hmm, so, a deepgroup would be best used with bullets and other small arms. They can impact things but aren't hindered by them. Atom(Groups) would make for better missiles or MOs that should be affected by outside forces.

Am I on the right track here?


Wed Dec 28, 2011 11:59 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post Re: Newbie scripting questions
Not quite. Everything has to have an AG and a DG, and it can be autodefined by the pixels (most things are) or you can define the atoms yourself. Bullets use DGs, but DGs aren't what make it hit other people, they're what make it destroy terrain. What you want, in fact, is very little DG to prevent terrain rape and much greater AG to give it some *umph* against other MOs.


Thu Dec 29, 2011 3:30 am
Profile
User avatar

Joined: Sun Jan 28, 2007 10:32 pm
Posts: 1609
Location: UK
Reply with quote
Post Re: Newbie scripting questions
A few things I've seen don't have DeepGroups and have "DeepCheck = 0", for the record. A lot of MOPixels don't seem to have DeepGroups or similar effects either.

Useful to know, though.

To be honest, I guessed it was like more like the internal/external materials, and could be used to simulate, for instance, an empty soft drink can; the outside (AtomGroup) is made of aluminium, while the inside (DeepGroup) is made of air.


Thu Dec 29, 2011 3:52 am
Profile YIM

Joined: Wed Dec 14, 2011 3:46 am
Posts: 20
Reply with quote
Post Re: Newbie scripting questions
Ah, ok, that clarifies it, thank you!

I've been working on a simple test pistol script, and it's giving me a problem that has me stumped.

Whenever the mod loads, it crashes and I get the error message:

"Could not match property in MyFirstMod.rte/devices/SyzPistol.ini at line 5!"

In my SyzPistol.ini all that's written on line 5 is Mass = 6. I don't see the problem there, that seems like a rather standalone value, nothing else in the .ini should be causing any conflict, and I don't know how the game is having trouble finding the property of the Mass value.

Anyone have any idea what's going on?

EDIT: If it's easier, here's the first 23 lines of the .ini, exactly as I have written it.
Code:
///////////////
// Rounds

AddEffect = MOSParticle
   Presetname = Bullet Syzygy Pistol
   Mass = 6
   LifeTime = 900
   Sharpness = 150
   HitsMOs = 1
   GetsHitsbyMOs = 0
   Color = Color
      R = 120
      G = 0
      B = 220
   Atom = Atom
      Material = Material
         Copyof = Wet Concrete
   TrailColor = Color
      R = 120
      G = 0
      B =220
   
   TrailLength = 60


It counts any line with // as an actual line right? If so then it's either having an issue with the Lifetime or Sharpness, and I don't really see anything inherently wrong with those values.


Last edited by Zazix on Sat Dec 31, 2011 8:30 am, edited 1 time in total.



Sat Dec 31, 2011 6:59 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: Newbie scripting questions
Is the tabbing done correctly?

You should use the code display [code][/code] to show it better, or directly upload the file.


Sat Dec 31, 2011 7:21 am
Profile

Joined: Wed Dec 14, 2011 3:46 am
Posts: 20
Reply with quote
Post Re: Newbie scripting questions
Asklar wrote:
Is the tabbing done correctly?

You should use the code display [code][/code] to show it better, or directly upload the file.


Fix'd. Any of the 3 lines it may be referring to should be single tab lines, or so I believe... I hate not knowing things.


Sat Dec 31, 2011 8:32 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: Newbie scripting questions
They all look tabbed correctly.

I don't know what might be the problem then. Check if you wrote an extra space after the number, like "Mass = 6 ".
Or, you can try copying everything on that file and then delete it, then you create another ini file and paste everything there.


Sat Dec 31, 2011 8:37 am
Profile
User avatar

Joined: Wed Feb 17, 2010 12:07 am
Posts: 1545
Location: That small peaceful place called Hell.
Reply with quote
Post Re: Newbie scripting questions
Code:
Presetname


Should be

Code:
PresetName


Also your trail color needs to all be tabbed up one and your trail color Blue value needs a space.

Code:
AddEffect = MOSParticle
   PresetName = Bullet Syzygy Pistol
   Mass = 6
   LifeTime = 900
   Sharpness = 150
   HitsMOs = 1
   GetsHitsbyMOs = 0
   Color = Color
      R = 120
      G = 0
      B = 220
   Atom = Atom
      Material = Material
         Copyof = Wet Concrete
      TrailColor = Color
         R = 120
         G = 0
         B = 220
      TrailLength = 60


EDIT: Good call Arcalane.


Last edited by Coops on Sat Dec 31, 2011 11:42 am, edited 2 times in total.



Sat Dec 31, 2011 10:30 am
Profile
User avatar

Joined: Sun Jan 28, 2007 10:32 pm
Posts: 1609
Location: UK
Reply with quote
Post Re: Newbie scripting questions
That TrailLength probably needs to be tabbed up too, looking at all the other weapons I have on hand.


Sat Dec 31, 2011 11:01 am
Profile YIM

Joined: Wed Dec 14, 2011 3:46 am
Posts: 20
Reply with quote
Post Re: Newbie scripting questions
Ouch, I didn't even notice that spelling error. Found quite a few more going down the lines, so hopefully that'll solve a few more problems. The extra tabs seem to have worked as well, although now it's telling me that it can't find the property of line 11, which would be the Color = Color bit. I tried messing with the tabbing, but it still takes issue with it for some reason. If it isn't the tabbing that's the problem, I can't really think of what else would be, as it's pretty hard to misspell Color (unless CC requires me to use the British version, Colour)


Sat Dec 31, 2011 9:51 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 21 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users


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 © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.048s | 14 Queries | GZIP : Off ]