Author Topic: Three scripting questions  (Read 7311 times)

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Three scripting questions
« on: March 28, 2010, 10:49:31 PM »
1.  How do I set an empire's ingame colour?  Is it possible to specify this in the level?  For example if I want Empire 2 to always be red..

2.  How does the SetVignetteAlpha command work?  Can anyone show me the correct syntax?

3.  How do I set an asteroid name?  GetAsteriod(0).Name = "Fluffy" doesn't seem to work..

Alex

  • Administrator
  • Ent
  • *****
  • Thank You
  • -Given: 3
  • -Receive: 14
  • Posts: 1,035
Re: Three scripting questions
« Reply #1 on: March 29, 2010, 06:41:36 PM »
1. Don't think this is possible at the moment, will investigumate

2. Pretty sure it's a value from 0 to 1, need to clarify that though... will check it out and post back

3. I'll see what's up, it should work...

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Three scripting questions
« Reply #2 on: March 29, 2010, 07:15:05 PM »
RE 2..... aha!!!  I didn't realise that :>  I was using values between 0 and 255, and wondered why the vignette never changed from maximum.  Sweet!

Thanks dude!

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Three scripting questions
« Reply #3 on: March 30, 2010, 12:19:04 AM »
You should probably change the Scripting Reference RE point number 2, by the way...


Quote
SetVignetteAlpha   nil   Set the darkness of the vignette (value from 0 - 255)


I will try vignette again tonight using 0-1 as the value, and hopefully it will work.  :>
« Last Edit: March 30, 2010, 12:25:22 AM by annikk.exe »

Alex

  • Administrator
  • Ent
  • *****
  • Thank You
  • -Given: 3
  • -Receive: 14
  • Posts: 1,035
Re: Three scripting questions
« Reply #4 on: March 30, 2010, 02:13:32 AM »
What's actually occurring when you use it?

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Three scripting questions
« Reply #5 on: March 30, 2010, 02:42:34 AM »
eh..
« Last Edit: March 30, 2010, 06:07:34 AM by annikk.exe »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Three scripting questions
« Reply #6 on: March 30, 2010, 06:07:14 AM »
Ah... never mind... it turns out I had completely forgotten what the problem was :P  It was a while ago now that I tried to get it to work.

Anyway I tried it again this evening, and basically the command doesn't work...or maybe I don't have the syntax right, it's hard to tell.

I get this error:




...when I try to run this code:




annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Three scripting questions
« Reply #7 on: March 30, 2010, 06:15:31 AM »
Also, this code:




...results in:



It doesn't give a line number, but the level loads up fine before this command is added....

Alex

  • Administrator
  • Ent
  • *****
  • Thank You
  • -Given: 3
  • -Receive: 14
  • Posts: 1,035
Re: Three scripting questions
« Reply #8 on: March 30, 2010, 07:37:58 PM »
OK looks like the asteroid name needs to be exposed. It's read-only.

SetVignetteAlpha should be global scope, not asteroid-scope :)

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Three scripting questions
« Reply #9 on: March 30, 2010, 08:37:51 PM »
Oh right... so SetVignetteAlpha(210) instead of a:SetVignetteAlpha(210) ?  You can't set different vignettes for different asteroids?

Well in that case now I know why it wasn't working...but all the same, it would have been nice to be able to set the vignette for each asteroid seperately.  Hmm, I will try this again tonight :>


For the asteroid name, is that something you would have to fix or is there something else I can do to make it work?

Alex

  • Administrator
  • Ent
  • *****
  • Thank You
  • -Given: 3
  • -Receive: 14
  • Posts: 1,035
Re: Three scripting questions
« Reply #10 on: March 31, 2010, 12:03:33 AM »
I'll have to fix it, yeah.

The vignette is the thing that makes the screen look like it's inside a picture frame or whatever, the darkening around the edges. The asteroid atmosphere density is something I'd have to actually add :)

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Three scripting questions
« Reply #11 on: March 31, 2010, 12:28:26 AM »
Ah right :>  Can't quite picture in my head what that looks like... I'll have a look tonight

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Three scripting questions
« Reply #12 on: March 31, 2010, 08:57:15 AM »
Bah, I ended up getting too involved with the AI map I'm working on and forgot about this.  Sleep time now.  Eh..
I'll try it tomorrow.  Honest.  Hey, at least the AI should be good ! :>