CRPL -> PRPL?

Started by Oblivion, October 12, 2016, 08:53:45 AM

Previous topic - Next topic

Oblivion

Just so I don't have to walk through every bit of CRPL to see if it works as PRPL, what general commands used in CRPL have been transitioned into PRPL? obviously code involving creeper, anticreeper etc. aren't, but what about unit based commands?
~Memes have been scientifrically proven to be the very essence of life unto itself~

GoodMorning

I asked this question of planetfall, here's a (partial?) list (there are other functions that act on units, these are those used as UID.<text>:

Quote from: planetfall
ShipIsEnemy
UnitIsEnemy
ParticleIsEnemy (?)
ShipPixelCoordX
ShipPixelCoordY
ShipCoordX
ShipCoordY
UnitPixelCoordX
UnitPixelCoordY
UnitCoordX
UnitCoordY
ParticlePixelCoordX
ParticlePixelCoordY
ParticleCoordX (?)
ParticleCoordY (?)

UnitEnergy
UnitMaxEnergy
UnitHealth
UnitMaxHealth
TakeMapSpace (units)
UnitIsDestroyed
UnitLatheTargets
UnitMissionGoal

CreateFootprint (?????)

ParticleHealth
ParticleMaxSpeed
ParticleTarget
ParticleMaxDistance
ParticleMaxAge
ParticleDestroyAtEdge

UnitRecallChildParticles (?)

EmitterParticleType
EmitterProductionInterval
EmitterMaxParticles
EmitterMaxTime
EmitterMaxDistance
EmitterMaxParticleSpeed
EmitterParticleHealth
EmitterTargetProbability
"EMITTEREMITTERTARGETPROBABILITY"
EmitterRecallRange
EmitterDestroyeAtEdge [sic]
EmitterEnemyPattern
EmitterBondDistance
EmitterBondStiffness
EmitterChainLength
EmitterMaxChainLength
EmitterShapeSize

ShipHullSize
ShipCMCost
ShipCMBuiltAmt
ShipIsConnectedToEnergyMine

UnitMireDamages
UnitMireDamageAmt
UnitShipHullDamages
UnitParticlesDamage

ShipHasAmp
ShipRotation
ShipRotationDegrees
ShipIsDestroyed
ShipHullSize
ShipHullBuilt
ShipHullWidth
ShipHullHeight

Probably more, some are probably wrong (may need to add or remove "unit" from the front.)

This is why we need a wiki, but until the :rpl namespace is created or V makes the docs, this kind of thing will have to do.
A narrative is a lightly-marked path to another reality.

Oblivion

I'll just continue this like a wiki, but does anyone know how particle target works? As in your aiming the particle at a target or choosing which targets the particle goes for?
~Memes have been scientifrically proven to be the very essence of life unto itself~

Karsten75

Quote from: Oblivion on October 13, 2016, 06:49:58 PM
I'll just continue this like a wiki, but does anyone know how particle target works? As in your aiming the particle at a target or choosing which targets the particle goes for?

It seems kind of strange to me.

The actual CreateParticle statement doesn't have a target option.

You can interrogate a particle with the FindParticleTarget statement

Findparticle (UID,f1, f2, f3)

where  f1 is probablity of following a target?, f3, is probability to follow a ship and f3 probability to follow  an emitter

I know that there is a setEmitterTargetProbability statement that sets the probability that a specific particle will either be "free", or be targeting ships or energy sources.

You can see the parameters for that in the Emitter settings in the editor.

Right now I'm wading through the stuff, so I don't really know more than I gave you here. ;)

Karsten75

Actually, there are two more Particle APIs

SETPARTICLETARGET:
                    i2 =  //Target Object UID
                    i1 = //Particle UID

GETPARTICLETARGET
                  i1 //Particle UID
returns:  target UID.

Oblivion

Ayyyy thank you! Also, are you going through the code through testing or do you have access to the code that powers the code in the game? Just wondering. Thanks for the help though.
~Memes have been scientifrically proven to be the very essence of life unto itself~

Oblivion

Are particles completely based off pixel coords or is there a way to use regular coords with them. I cannot get the game to give me their "coords" but pixel coords work fine.
~Memes have been scientifrically proven to be the very essence of life unto itself~

GoodMorning

Insofar as my knowledge stretches, pixel coords are best at this point.

Given the workings of PRPL, it would not surprise me to find that it will largely run off pixel coords, with minor use of cell coords, in direct contrast to CRPL.
A narrative is a lightly-marked path to another reality.

Karsten75

Are these the commands you're using?  THere is some new notation, not sure exactly how and how the format should pan out.

GETPARTICLEPOSITION (i1 )#Particle UID

#returns to stack
#         position.x
#         position.y as floating point.
      


SETPARTICLEPOSITION (f2, f1, i1)  # (y, x, uid)

GoodMorning

Those commands run off pixel coords. Float = pixel, int = cell.
A narrative is a lightly-marked path to another reality.

Karsten75

CELLTOPIXEL(    i2,    i1)
   stack wx
   stack wy)
   
PIXELTOCELL (   f2 ,   f1 )
   stack x
   stack y

Oblivion

Thanks for the help on the last one, but, with your almighty cheat sheet, can you tell me the params for
UnitShipHullDamages
UnitParticlesDamage
Karsten? :D
~Memes have been scientifrically proven to be the very essence of life unto itself~

planetfall

Uid and bool specifying if it takes damage from the specific thing.
Pretty sure I'm supposed to be banned, someone might want to get on that.

Quote from: GoodMorning on December 01, 2016, 05:58:30 PM"Build a ladder to the moon" is simple as a sentence, but actually doing it is not.

Oblivion

~Memes have been scientifrically proven to be the very essence of life unto itself~

Oblivion

Whats the destroy ship command? I know it was stated to be DestroyShip but I've tested variants like DestroyCurrentShip. DestroyShips, Destroy, etc. still doesn't work ;-;
~Memes have been scientifrically proven to be the very essence of life unto itself~