Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: HiggsBoson12 on November 06, 2014, 08:43:19 AM

Title: A question on how does the Enable Tower Field code work.
Post by: HiggsBoson12 on November 06, 2014, 08:43:19 AM
In my map "Saving Humanity Pt 6," I have a CRPL core that creates a lot of AC from ammo. In a previous post, I managed to iron out the biggest component of the unit, but when tinkering with it a little bit, I ran into another issue. What it is supposed to do is create a field that sucks in Creeper. When the unit produces AC, it is supposed to reverse the field, flinging the AC far away. The current piece of scripting is as follows.

#Make a large field that sucks in Creeper
30 -1000 True EnableTowerField

I am not sure what the wiki means by Angle in Radians. I know what radians are, but I want a unit that creates the inverse of what the vanilla shield unit does in-game. Any explanation about how to make the code work would be much appreciated. Because this is the final map in the series, I really want to create an intense experience, and that means a lot of interesting CRPL.
Title: Re: A question on how does the Enable Tower Field code work.
Post by: elNabot on November 08, 2014, 05:28:03 AM
 
Quote from: HiggsBoson12 on November 06, 2014, 08:43:19 AM
30 -1000 True EnableTowerField

You are missing arguments in your call. EnableTowerField takes 5 arguments, not 3.

If you use a trace window with ShowTraceLog it should display error messages that help you debug  :) .

In this case it is WARNING: Taking item from an empty stack : ENABLETOWERFIELD at line xx
WARNING: Taking item from an empty stack : ENABLETOWERFIELD at line xx


For your problem, try this line :

EnableTowerField(30 -100000 -100000 0 TRUE)


Don't hesitate to use really high values for the strength, otherwise the effect won't be noticable.

Also, try to use the warp notation, it makes code a lot easier to read and understand (and correct  ;) ).
Title: Re: A question on how does the Enable Tower Field code work.
Post by: HiggsBoson12 on November 09, 2014, 09:23:16 AM
It works! Thank you very much. You are helping to move my greatest map ever one step closer to completion!
Title: Re: A question on how does the Enable Tower Field code work.
Post by: HiggsBoson12 on November 09, 2014, 09:49:53 AM
I was fiddling with the code, and I was wondering if it was possible to create a field that pulls in creeper and repels anticreeper. I tried, but it doesn't seem possible. I don't need it for my map, but I was just wondering if it was possible, so I could tinker with it.
Title: Re: A question on how does the Enable Tower Field code work.
Post by: warren on November 17, 2014, 07:53:26 AM
Hey! I did that! push one pull another. The default tower field for this is broken last I checked, so I did it manually using SetFieldCell.
Title: Re: A question on how does the Enable Tower Field code work.
Post by: HiggsBoson12 on November 24, 2014, 12:27:02 PM
Thank you for letting me know, I will check it out