Missing CRPL commands

Started by Grauniad, October 25, 2013, 09:57:33 AM

Previous topic - Next topic

Grauniad

Update:

Today, 2/2/2014, I obtained a new list from Virgil containing all CRPL commands. I created an auto-reference list and placed it in the wiki. All missing commands now appear in red in that list. If you add a command, then it will not show in red, but in green. If Virgil adds more commands, we can but hope he'll at least add it to this list. :)

Previously, Virgil said this about any work done on the command reference:
QuoteNow some of these you may not know what they are, so just leave them.  Others, it may not be clear what section to stick them in.  And some will probably be clear.  Any of them that you get added will be that much less I have to sort out, so thanks in advance.

Again: Missing CRPL command List





Now some of these you may not know what they are, so just leave them.  Others, it may not be clear what section to stick them in.  And some will probably be clear.  Any of them that you get added will be that much less I have to sort out, so thanks in advance.

FailMission
GetTargetOffsetX, GetTargetOffsetY, SetTargetOffsetX, SetTargetOffsetY
SetPopupText, SetPopupTextX, SetPopupTextY, SetPopupTextAlwaysVisible
PauseGame UnpauseGame,
GetGameTimeFrames
SetScripVar and GetScriptVar for built in units.
GetNearestGroundEnemy
SetCreeperMax, SetAntiCreeperMax
ShowMessageDialog, IsMessageDialogShowing
GetUnitTransformPosition
SetCreeperColors,GetCreeperColors
SetTerrainOverride, GetTerrainOverride
SetScreenMode, SetScreenCoords, SetScreenCoordX, SetScreenCoordY, SetScreenPixelCoords, SetScreenPixelCoordX, SetScreenPixelCoordY,
CreateListStartingSize, AppendStackToList, PrependStackToList
NotPersist
SetText, SetTextColor, SetTextSize, SetTextX, SetTextY, SetTextAnchor
GetScore, SetAdditionalScore, GetAdditionalScore, AddAdditionalScore
ToUpper, ToLower
StackSize


Now constants to add to the GetUnitAttribute page
CONST_SHOWHEALTHBAR, CONST_SHOWAMMOBAR, _CONST_SHOWAMMOACBAR



To tell what button is pressed on a message dialog.

In your script you need to add an intrinsic function called.
:ShowMessageDialogCallback

That function will get called whenever a message dialog is closed.  When it is called, an int is present on the stack that indicates which button.  0 means OK and 1 means cancel.

So this should work in a script.

:ShowMessageDialogCallback
  ->result
  trace2("Button: " <-result)


[/s]
A goodnight to all and to all a good night - Goodnight Moon

ThirdParty

How about unit types?  For example, one of the code examples has a ' "TOTEM" CurrentCoords CreateUnit ' command, but TOTEM isn't listed as a valid unit type on the pages for CreateUnit and GetUnitType.

Quote from: Grauniad on October 25, 2013, 09:57:33 AMAny of them that you get added will be that much less I have to sort out, so thanks in advance.
The wiki doesn't allow ordinary users to create pages, so unless you at least create a blank page for each command, there's exactly zero chance that some user will figure out how it works and create documentation for it.

thepenguin

Quote from: ThirdParty on October 25, 2013, 05:17:07 PM
The wiki doesn't allow ordinary users to create pages, so unless you at least create a blank page for each command, there's exactly zero chance that some user will figure out how it works and create documentation for it.
I'll take care of some blanks for everyone.
We have become the creeper...

Grauniad

Quote from: ThirdParty on October 25, 2013, 05:17:07 PM
The wiki doesn't allow ordinary users to create pages,

For those able to contribute, let me know (post here or PM) and I can elevate them to the esteemed position of "editor" who can create pages in the wiki.  Eventually we'll lift the restriction, but consider the wiki in an extended beta  mode for now.
A goodnight to all and to all a good night - Goodnight Moon

ThirdParty

Quote from: Grauniad on October 25, 2013, 06:57:37 PMFor those able to contribute, let me know (post here or PM) and I can elevate them to the esteemed position of "editor" who can create pages in the wiki.  Eventually we'll lift the restriction, but consider the wiki in an extended beta  mode for now.
I'm willing to help, at least a little.  I'm trying to learn CRPL anyway, I'd might as well be adding documentation as I figure things out.

Grauniad

If you log in/out here and in the Wiki, you should be able to create pages now.
A goodnight to all and to all a good night - Goodnight Moon

ThirdParty

Quote from: Grauniad on October 25, 2013, 08:54:08 PMIf you log in/out here and in the Wiki, you should be able to create pages now.
Thanks!

I've skimmed through all the main story mission looking for undocumented commands, and listed them on the CRPL Reference page.  (Many of them are still undocumented, but at least people will know that they exist.)  The best find was "GetAllUnitsInRange", which will greatly simplify a map I've been thinking about doing.

I suspect that there are still some missing commands.  For example, there ought to be a way to create an air exclusion field around a CRPL tower, but it's undocumented.

jsmith45

I've gone ahead and added all the remaining undocumented commands to the CRPL Reference page.

I put a few in the Utility sections when I had trouble figuring out where they would best go.

Some of the interesting commands now listed (but not documented) include : "DropFromOrbit", "AscendToOrbit", "DestroyAllEnemyUnits", "CreateIndicatorArrows", "GetCurrentBuildTab" (the last two being used in the tutorial missions to guide the player), "SetTechArtifactType", and "EnableAlternateControlMode" (hides the normal build panels, used in the credits mission, among other places).

I also added the remaining two special special :functions that can get called automatically by the game.

Clean0nion

I don't have user permission to create these pages. All the needed code is here.

SETSYSTEMINHIBITED (utility)

Spoiler
~~DISCUSSION~~
<- [[crpl:crplreference|CRPL reference]] <- [[crpl:crplreference#utility_commands|Utility Commands]]
=====  SetSystemInhibited  =====

^Arguments^Result^Notation^
| Boolean |None | n1 -- |

=== Description ===
Sets whether or not the next star system is unreachable. Only used in Arc Eternal; do not use in custom CRPL units.
=== Examples ===
<code>
SetSystemInhibited (FALSE)
</code>
[close]

SHOWCONVERSATION (conversation)

Spoiler
~~DISCUSSION~~
<- [[crpl:crplreference| CRPL reference]] <- [[crpl:crplreference#conversation_commands|Conversation Commands]]
=====  AddConversationMessage  =====

^Arguments^Result^Notation^
|None|None| -- |

=== Description ===

Opens the current conversation.

=== Examples ===
<code>
ClearConversation
0 "Where am I?" AddConversationMessage
1 "You're on a planet!" AddConversationMessage
ShowConversation
PauseGame
</code>
[close]

ASCENDTOORBIT (unit)

Spoiler
~~DISCUSSION~~
<- [[crpl:crplreference| CRPL reference]] <- [[crpl:crplreference#unit_commands|Unit Commands]]
=====  DropFromOrbit  =====

^ Arguments ^ Result ^ Notation ^
|None|None| - |

=== Description ===

The unit rises from its current coordinates and ascends to orbit. This creates exactly the same effect that sending a CN to orbit does. Once the unit is ascended it counts as destroyed, as in it is no longer on the map, but it can be recovered by pushing DropFromOrbit.

<code>
"Bye bye!" SetText
AscendToOrbit
</code>
[close]

CURRENTPIXELCOORDS (unit)

Spoiler
~~DISCUSSION~~
<- [[crpl:crplreference|CRPL reference]] <- [[crpl:crplreference#utility_commands|Utility Commands]]
=====  CurrentPixelCoords  =====

^Arguments^Result^Notation^
| |Pixel X and Y coords of unit |''-- X1 Y1 ''|


=== Description ===
Pushes the current unit's X coordinate and Y coordinate in floating point pixel space to the stack.
=== Examples ===
<code>CurrentPixelCoords trace2</code>

[close]

Grayzzur

Quote from: Clean0nion on December 09, 2013, 12:47:27 PM
I don't have user permission to create these pages. All the needed code is here.
Added. I took a quick proofread pass, but if they're not perfect, you should be able to edit them now that they exist.
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker

Grauniad

Quote from: Clean0nion on December 09, 2013, 12:47:27 PM
I don't have user permission to create these pages. All the needed code is here.

You should now have permission. Log in/out, both here and in the wiki if you don't yet see the elevated privilege.
A goodnight to all and to all a good night - Goodnight Moon

stewbasic

If it's not too much trouble, could I also have create page permission? I'm not sure how much editing I'll have time for, but I should be able to fill in a couple of functions at least.

Grauniad

A goodnight to all and to all a good night - Goodnight Moon

Grauniad

A goodnight to all and to all a good night - Goodnight Moon

kai

Nice to see the update of ref wiki.
And I found some interesting things in the syntax highlighting, which is not in any part of wiki :D :
CONST_GETATTRIBUTE
CONST_SETATTRIBUTE