Creating Emitters Within a Range {original problem solved}

Started by milkev, February 04, 2016, 07:41:24 PM

Previous topic - Next topic

milkev

Hello, first time on the forums so i hope im not breaking any rules.

So im trying to create A code that spawns Emitters in a range around CurrentCoords. This is my code.

Its telling me that the range has to be previously set.(?) in the create unit line.(Edit: Sorry this if because i accidentally created a $range on the title line)

------------------------------------(not part of code)

$range:30

CreateUnit("EMITTER" CurrentCoords <-range RandCoordsInRange) ->uid

------------------------------------(not part of code)

I hope there is someone smarter than me that can figure this out as i dont know to much about using code in CW3.
Entire code/File is attached

If you see any other problems in this code please tell me and if this isnt the right way to go about this also please tell me.
p.s. Also wondering if i could somehow create it with stats?

TLFP

#1
Quote from: milkev on February 04, 2016, 07:41:24 PM
Hello, first time on the forums so i hope im not breaking any rules.

So im trying to create A code that spawns Emitters in a range around CurrentCoords. This is my code.

Its telling me that the range has to be previously set.(?) in the create unit line.

------------------------------------(not part of code)

$range:30

CreateUnit("EMITTER" CurrentCoords <-range RandCoordsInRange) ->uid

------------------------------------(not part of code)

I hope there is someone smarter than me that can figure this out as i dont know to much about using code in CW3.
Entire code/File is attached

If you see any other problems in this code please tell me and if this isnt the right way to go about this also please tell me.
p.s. Also wondering if i could somehow create it with stats?
I had someone create a script that did something like that
CreateUnit("EMITTER" RandCoordsInRange(CurrentCoords 12)) ->unit
If you want to customize the emitters, I can give you the wiki page on that.
Currently ghosting, don't mind me.
Christian, my list of various content creation groups can be found here

milkev

Thanks fellow long player, i think i understand how it works. does the ->uid have to be ->unit?
so sorry for such silly questions, im almost completely new to this.
-milkev

Builder17

What you are meaning with stats?

TLFP

#4
I used something to change the stats (amount emitted). Here's the script. You can look at it to figure it out.  :)
And you can name the ->unit id anything you want, just so you can customize it.
Currently ghosting, don't mind me.
Christian, my list of various content creation groups can be found here

milkev

Wow thanks! just one more question(probably ;) )
So If I wanted it to choose between a set of random cords (pre-made) to create the emitter there how would I do that without it spawning it in a set that already has something there?

TLFP

#6
Quote from: milkev on February 05, 2016, 04:03:04 PM
Wow thanks! just one more question(probably ;) )
So If I wanted it to choose between a set of random cords (pre-made) to create the emitter there how would I do that without it spawning it in a set that already has something there?
This should help. http://knucklecracker.com/wiki/doku.php?id=crpl:docs:randcoordsinrange
Unit coordinates can be found in edit mode in the bottom right corner.
Currently ghosting, don't mind me.
Christian, my list of various content creation groups can be found here

Builder17

You can set now range , emit amount  , emit interval , and delay.
Is it good , or do you want something else to it?
Edit: Could you take a look at this one before you say it's not good? :)

milkev

Quote from: Builder17 on February 06, 2016, 02:35:10 AM
You can set now range , emit amount  , emit interval , and delay.
Is it good , or do you want something else to it?
actually i was wondering if i had a pre made set of coords could i choose randomly between them?

milkev

Quote from: Builder17 on February 06, 2016, 02:35:10 AM
You can set now range , emit amount  , emit interval , and delay.
Is it good , or do you want something else to it?
Edit: Could you take a look at this one before you say it's not good? :)
I put the script into my crpl core, but it doesnt seem to do anything. I compiled the list and it says there's no issues, I don't know what half the stuff actually means so i have no idea what the problem could be.

P.S. My text editor 'edits' out all the
"
" in files that are downloaded, but idk why, so i also have no idea what lines are witch :D

TLFP

Quote from: milkev on February 06, 2016, 06:58:21 PM
Quote from: Builder17 on February 06, 2016, 02:35:10 AM
You can set now range , emit amount  , emit interval , and delay.
Is it good , or do you want something else to it?
Edit: Could you take a look at this one before you say it's not good? :)
I put the script into my crpl core, but it doesnt seem to do anything. I compiled the list and it says there's no issues, I don't know what half the stuff actually means so i have no idea what the problem could be.

P.S. My text editor 'edits' out all the
"
" in files that are downloaded, but idk why, so i also have no idea what lines are witch :D
I looked at the script and the list1 part is where you enter map coords. I think you enter them in and it will create the emitters. You could PM Builder17 and ask him how to do it.
Currently ghosting, don't mind me.
Christian, my list of various content creation groups can be found here

Builder17

I cannot make it working , try something better.  :-[