Author Topic: [Solved] New to scripting~~~Need help with project  (Read 3399 times)

Offline vadracas

  • Colonel
  • ****
  • Posts: 285
  • Just another player/modder combo.
    • View Profile
[Solved] New to scripting~~~Need help with project
« on: May 15, 2020, 10:10:16 pm »
I'm attempting to write a script to create more varied enemies-
 First problem: I attempted to make it so that only enemies would get the tags but have no idea if that part of the script is functioning.

Second problem: tags aren't being applied to any enemy ever.


Attaching the mod-please provide any critical feedback you have.
« Last Edit: February 12, 2023, 02:53:31 pm by Meridian »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9078
    • View Profile
Re: New to scripting~~~Need help with project
« Reply #1 on: May 15, 2020, 10:19:48 pm »
Sorry to say, but your script is 100% gibberish.

Can't really give any kind of feedback on that.

Offline vadracas

  • Colonel
  • ****
  • Posts: 285
  • Just another player/modder combo.
    • View Profile
Re: New to scripting~~~Need help with project
« Reply #2 on: May 15, 2020, 10:24:52 pm »
ok... I was literally reading from the scripting page on UFOpaedia and the API, so idk.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9078
    • View Profile
Re: New to scripting~~~Need help with project
« Reply #3 on: May 15, 2020, 10:32:36 pm »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: New to scripting~~~Need help with project
« Reply #4 on: May 15, 2020, 10:37:32 pm »
In the 40k mod we use a script to set random appearances for a certain type of enemy unit - you can check in our script files for the createUnit scripts for inspiration.

Offline vadracas

  • Colonel
  • ****
  • Posts: 285
  • Just another player/modder combo.
    • View Profile
Re: New to scripting~~~Need help with project
« Reply #5 on: May 15, 2020, 11:11:12 pm »
Thank you both!

So if I were to do what's outlined in your example, Meridian, would I have to copy/paste the script for every armor in every mod that I would want to use this with, or is there a way to make it apply automatically to all armors through a refnode or something?

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: New to scripting~~~Need help with project
« Reply #6 on: May 15, 2020, 11:13:56 pm »
Check how scripts are used in 40k, XCF, or Piratez - you can define a new tag to put on armors or items you want to interact with scripts.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9078
    • View Profile
Re: New to scripting~~~Need help with project
« Reply #7 on: May 15, 2020, 11:17:11 pm »
So if I were to do what's outlined in your example, Meridian, would I have to copy/paste the script for every armor in every mod that I would want to use this with, or is there a way to make it apply automatically to all armors through a refnode or something?

My example was just a "local" script.

You can easily make a "global" script ... like you tried in your example... which applies to all (or tagged) armors.
Just study some existing scripts first, to get a feeling for it.