Getting Started

Started by pastor.healer, February 02, 2015, 09:57:42 PM

Previous topic - Next topic

pastor.healer

Time to upgrade map making... 

I just have a few questions...

I have figured out how to place a core on the map.  I am guessing where it is doesn't matter except for offsetting future functions from
it.  Is that correct thinking?

Then I clicked on scripting and created a notepad file where I cut and pasted some practice code from the The Coders Corner. 

Then I dblclicked on the core and added the code to that core. 

Running the game each time I am not getting anything to happen. 

I just need to get some help getting started.  From there I should be good to go.  :)

Thanks

Asbestos

What is the script you are using?

planetfall

Did you save the script and then hit compile all?
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.

pastor.healer

Well I tried the first two of Virgils examples.  Then I tried the moving emitter snippet and it works.  I don't know why the other
two didn't.  Beginners stuff.  :(

I have looked all over and can't find how out to change the graphics of the core used in the moving emitter code.  I think I have
seen others use different graphics for this. 

Hubs

You can put ShowTraceLog in your script and that can sometimes help identify bugs in your code. It will show error messages in a window next to your core. Also, you can display a variable or anything really in the trace log. The Trace command outputs the first value on the stack to the trace log.  Keep in mind whatever you trace will happen every frame, so your log can fill up quickly. ClearTraceLog will clear it. Alot of the time I will show the trace log and clear at the start of each frame, then output what I'm trying to debug.

You can change the graphics of any core two ways:

For the main image used by the core there is a parameter when you select the core in the editor.
Also, you can change it in CRPL using SetImage.

If you have a new graphic, you'll need to add it to the map in the custom images screen (It's on the unit tab of the edit panel).

pastor.healer

Thank you Hubs.  That seems straightforward.  Yea!

:)