A question on how does the Enable Tower Field code work.

Started by HiggsBoson12, November 06, 2014, 08:43:19 AM

Previous topic - Next topic

HiggsBoson12

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.
CRPL=Fun=Frustration

elNabot

 
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  ;) ).

HiggsBoson12

It works! Thank you very much. You are helping to move my greatest map ever one step closer to completion!
CRPL=Fun=Frustration

HiggsBoson12

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.
CRPL=Fun=Frustration

warren

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.

HiggsBoson12

CRPL=Fun=Frustration