Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: pastor.healer on February 02, 2015, 09:57:42 PM

Title: Getting Started
Post by: pastor.healer on February 02, 2015, 09:57:42 PM
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
Title: Re: Getting Started
Post by: Asbestos on February 02, 2015, 10:16:52 PM
What is the script you are using?
Title: Re: Getting Started
Post by: planetfall on February 02, 2015, 10:19:27 PM
Did you save the script and then hit compile all?
Title: Re: Getting Started
Post by: pastor.healer on February 02, 2015, 10:39:42 PM
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. 
Title: Re: Getting Started
Post by: Hubs on February 03, 2015, 11:50:02 AM
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).
Title: Re: Getting Started
Post by: pastor.healer on February 04, 2015, 08:22:12 PM
Thank you Hubs.  That seems straightforward.  Yea!

:)