Creating a core

BilboGCL · 1792

BilboGCL

  • Community Guild
  • *****
    • Posts: 485
Creating a core
on: November 28, 2017, 03:48:44 pm
Hi, as a follow up to my :destroyed question:
I try to build a core with a script, the core shouldn't be visible, don't take any map space and don't count for victory:

Code: [Select]
CreateUnit ("CRPLCore" 1 1) ->rest
<-rest "doe.crpl" AddScriptToUnit
<-rest "main" "none" SetImage
SetScriptVar ("CONST_COUNTSFORVICTORY" 0)
SetScriptVar ("CONST_CELLHEIGHT " 0)
SetScriptVar ("CONST_CELLWIDTH " 0)
SetScriptVar ("CONST_TAKEMAPSPACE " 0)

Right now I know that it is invisible but takes map space, (victory counting test starts right now)...
Any idea what I'm doing wrong?

Greetings from The Shire!

Hey, come to the dark side Discord, we have cookies!


GoodMorning

  • Community Guild
  • *****
    • Posts: 3456
  • (Pusillanimous)
Re: Creating a core
Reply #1 on: November 28, 2017, 04:25:26 pm
It's:
Code: [Select]
<-rest CONST_COUNTSFORVICTORY 0 SetUnitAttribute
You'll be getting "taking from empty stack" errors in the trace.

There's another interpretation, but this looks more likely.

Edit: Corrections to the last line. I'm a poor typist at that time of day.
« Last Edit: November 28, 2017, 09:22:38 pm by GoodMorning »

A narrative is a lightly-marked path to another reality.


BilboGCL

  • Community Guild
  • *****
    • Posts: 485
Re: Creating a core
Reply #2 on: November 28, 2017, 04:56:04 pm
Good Morning, thanks a lot, You are really helpful!

Greetings from The Shire!

Hey, come to the dark side Discord, we have cookies!


GoodMorning

  • Community Guild
  • *****
    • Posts: 3456
  • (Pusillanimous)
Re: Creating a core
Reply #3 on: November 28, 2017, 09:25:26 pm
Here's an example of a script for a ghost core - this one exists to take packets, for things which need more than 30eps.

Code: [Select]
# ChargeGhost.crpl
# Created on: 11/20/2017 8:27:45 PM
# ------------------------------------------
once
@awake
Self CONST_CONNECTABLE 1 SetUnitAttribute
Self CONST_REQUESTPACKETS 1 SetUnitAttribute
Self CONST_CANREQUESTAMMO 1 SetUnitAttribute
Self CONST_CONNECTABLE 1 SetUnitAttribute

Self CONST_NULLIFIERDAMAGES 0 SetUnitAttribute
Self CONST_COUNTSFORVICTORY 0 SetUnitAttribute
Self CONST_CREATEPZ 0 SetUnitAttribute

Self CONST_AMMO 0 SetUnitAttribute
endonce

:awake
<-Owned not if Self 0 Destroy endif

Self CONST_SHOWAMMOBAR 0 SetUnitAttribute

Hopefully it helps a little for someone's issue at some point.

A narrative is a lightly-marked path to another reality.