Author Topic: Trouble with E2 chip. Please help.  (Read 96 times)

0 Members and 1 Guest are viewing this topic.

Offline StartedBullet

  • ****
  • Posts: 262
  • Gender: Male
  • Blissfully unaware, or am I?
  • Respect: +19
Trouble with E2 chip. Please help.
« on: December 07, 2010, 08:17:02 PM »
0
Hello, I've been trying to make my first E2 chip. However, it seems to have this error which makes NO sense :trollface:: right parenthesis missing to close function argument list at line 16, charecter 20.  :( :( :(

So heres my code:

@name Automatic missile
@inputs Fire Model:entity
@outputs IsFired
@persist Missile:entity Player:entity PlayerAimPos:vector
@trigger all
interval(5)

Player=owner()
PlayerAimPos=Player:aimPos()



if (Fire==1) {
IsFired=0   
 Missile=propSpawn(Model,0)
 Missile:applyForce(PlayerAimPos 1000) } #line 16
 


if (Missile:health()==0) {
 Fire=0 
 IsFired=1 }


Any ideas what the hell I'm doing wrong? I would much appreciate it!
Turned a new leaf.


Furry artist.

Offline Moo

  • *****
  • Posts: 559
  • Respect: +413
Re: Trouble with E2 chip. Please help.
« Reply #1 on: December 07, 2010, 08:30:05 PM »
0
PlayerAimPos 1000 o.O

Offline StartedBullet

  • ****
  • Posts: 262
  • Gender: Male
  • Blissfully unaware, or am I?
  • Respect: +19
Re: Trouble with E2 chip. Please help.
« Reply #2 on: December 07, 2010, 08:32:39 PM »
0
I thought the 1000 was the amount of force?
EDIT: It seems to be broken, maybe applyangforce will do. Thanks Moo.
« Last Edit: December 07, 2010, 08:55:13 PM by StartedBullet »
Turned a new leaf.


Furry artist.

Offline » Magic «

  • i play pc computer
  • ***
  • Windows UserLinux UserLeague PlayerOld Forum MemberCat LoverDedicated Summoner
    View More Badges!

  • Posts: 5075
  • Gender: Male
  • ↑ ↑ ↓ ↓ ← → ← → B A
  • Respect: +782
    • MagiCorp
Re: Trouble with E2 chip. Please help.
« Reply #3 on: December 08, 2010, 08:24:42 AM »
0
Code: (e2) [Select]
@name Automatic missile
@inputs Fire Model:entity
@outputs IsFired
@persist Missile:entity Player:entity PlayerAimPos:vector
@trigger all
interval(5)

Player=owner()
PlayerAimPos=Player:aimPos()



if (Fire==1) {
IsFired=0   
 Missile=propSpawn(Model,0)
 Missile:applyForce(PlayerAimPos, <FORCE-ETC-GOES-HERE>) } #line 16
 


if (Missile:health()==0) {
 Fire=0 
 IsFired=1 }

Offline Peetah

  • ******
  • League PlayerWindows UserDog Lover
    View More Badges!

  • Posts: 3000
  • Gender: Male
  • Respect: +823
Re: Trouble with E2 chip. Please help.
« Reply #4 on: December 08, 2010, 01:27:35 PM »
0
Hehe im to late.  :nomnom:
(Reg) Nezz45: peetah are you good with the weight tool?

Offline StartedBullet

  • ****
  • Posts: 262
  • Gender: Male
  • Blissfully unaware, or am I?
  • Respect: +19
Re: Trouble with E2 chip. Please help.
« Reply #5 on: December 09, 2010, 05:09:57 PM »
0
I pretty much revised the entire script:

@name RPG_Missile
@inputs Fire Indicator:entity Model:entity Target:entity TargetV:vector Reload
@outputs IsFired
@persist Missile:entity Target:entity TargetS:string LastSaidL:string Said TargetPos:vector X Y Z XYZ
@trigger all
interval(1000)
Gate=entity()


LastSaidL=owner():lastSaid():lower()

if (LastSaidL:sub(1,8)=="/target") {
    TargetS=LastSaidL:sub(9, LastSaidL:length())
}

if (TargetS!=""){
    Target=findPlayerByName(TargetS)
    Said=0
}
#by Jackorobot/Bayangan
#type /target [name]


if (Target:isPlayer()==1 & Said==0){
    print("Target acquired "+Target:name())
    Indicator:setColor(0, 255, 0)
    Said=1
}

TargetPos=Target:pos()
TargetPosN=TargetPos:normalized()
#X=TargetPos:x()
#Y=TargetPos:y()
#Z=TargetPos:z()
#XYZ=X Y Z





if (~Fire & IsFired==0) {
    Missile=propSpawn(Model, 0)
    IsFired=1
    Fire=0
}

if (IsFired==1) {
    timer("Delay", 500)
   
   
Missile:applyForce( TargetPosN+random(1, 5))
   
}

if (IsFired==1 & ~Reload) {
IsFired=0
}


The problem is that I cannot seem to put a vector(normalized) in to the parameters aswell as a force. Any ideas? I need 'em.
Turned a new leaf.


Furry artist.