Your Ad Here

Subscribe
 Post #321
 16th February 2010
Steven :D's Avatar
September 2009
660 Posts
Could anyone be assed to put all working E2's into some kind of folder and upload it?
 Post #322
 16th February 2010 Last edited by Divran; 16th February 2010 at 07:21AM..
Gold Member
Divran's Avatar
April 2008
4,474 Posts
Hi again, Divran!
Sorry to ask for another E2 (well, two actually. :T).
The first one is more of a question/request.

When I was making a Vtol, I got it all stable, and its hovering, but it keeps drifting..like it has no air resistance. I tried Hoverballs, but then it was harder to make it go...well..vertical. So, in short, what I'm asking for is an E2 that will provide Air Resistance, like a Hoverball's.
Code:
E:applyForce(-E:vel()*E:mass()*Multiplier)
My second request is a bit hard to explain, so you don't have to do it if you want. I'm thinking it would require applyTorque, but I may be wrong.
Did you ever see one of those Vtols with two "wheels" on the side? It would look something like this from an overhead view. O-T-O ,where T is the body, and the two circles on each side are "wheels" which rotate on an axis, providing thrust in different angles. So, what I'm trying to ask is prehaps an E2 that will rotate the two axis'd 'wheels' a little bit forwards or backwards, but not all the way. Eg: No more then a 90 degree angle back and forth. Thank-you! :D

(Sorry it's really long. x_x')
You could use either applyTorque or applyAngForce for this. You could take a look at this:
http://www.wiremod.com/forum/contrap...tml#post136209
and
http://www.wiremod.com/forum/contrap...tml#post150097

Edited:

Could anyone be assed to put all working E2's into some kind of folder and upload it?
No, not really
 Post #323
 16th February 2010 Last edited by Timenova; 16th February 2010 at 08:20AM..
Timenova's Avatar
November 2009
1,079 Posts
Hi again, Divran!
Sorry to ask for another E2 (well, two actually. :T).
The first one is more of a question/request.

When I was making a Vtol, I got it all stable, and its hovering, but it keeps drifting..like it has no air resistance. I tried Hoverballs, but then it was harder to make it go...well..vertical. So, in short, what I'm asking for is an E2 that will provide Air Resistance, like a Hoverball's.

My second request is a bit hard to explain, so you don't have to do it if you want. I'm thinking it would require applyTorque, but I may be wrong.
Did you ever see one of those Vtols with two "wheels" on the side? It would look something like this from an overhead view. O-T-O ,where T is the body, and the two circles on each side are "wheels" which rotate on an axis, providing thrust in different angles. So, what I'm trying to ask is prehaps an E2 that will rotate the two axis'd 'wheels' a little bit forwards or backwards, but not all the way. Eg: No more then a 90 degree angle back and forth. Thank-you! :D

(Sorry it's really long. x_x')

You mean a V-22 Osprey? I'm trying to make one of them as well, but its trickier than I imagined. I need it to actually get into the air without flopping straight down...

For an E2, would it be possible to make some kind of security scanner that recognises only the people who have been chosen for clearance, and rejects the others? I need this for security doors in my fortress. :) Thanks a lot. Basically I would like it so that it 'scans' people within range and either opens the door if they are registered to come in, or to activate a turret that shoots them. I know this sounds laughably simple, but I am no good at wiremod and I suppose an E2 would make it simpler to set up...again, if you can do this, thanks. :)
 Post #324
 16th February 2010
cyber meat's Avatar
February 2010
5 Posts
hi i know this doesent have eneything to do with what ur talking about but my steam profile was hijacked (hacked) by one of my steam friends so i wonder if eney one know eney steam hacker program to pay back???
 Post #325
 16th February 2010
Gold Member
whosdr's Avatar
July 2008
2,795 Posts
Cyber, stop spamming the forums. Your going to end up getting banned.
 Post #326
 16th February 2010
Steven :D's Avatar
September 2009
660 Posts
Five posts is not really spam but there are no legit programs to hack accounts. And besides, you probably did something retarded and allowed him onto your account so that's your own damn fault
 Post #327
 16th February 2010
Niyo's Avatar
January 2010
12 Posts
Code:
E:applyForce(-E:vel()*E:mass()*Multiplier)


You could use either applyTorque or applyAngForce for this. You could take a look at this:
http://www.wiremod.com/forum/contrap...tml#post136209
and
http://www.wiremod.com/forum/contrap...tml#post150097

Edited:



No, not really
Thank you SO much :o
I support this E2 thread.
 Post #328
 16th February 2010
Gold Member
whosdr's Avatar
July 2008
2,795 Posts
I often use something like
E:applyForce( ( (Target - Current)*20 - E:vel()):setX(0):setY(0))*E:mass())
 Post #329
 17th February 2010
slashsnemesis's Avatar
July 2009
476 Posts
I need help figuring out how to make something stop after I release the w or s keys. And also go backwards when I press the S key.

Code:
@name Helper Bot
@inputs Active W S
@outputs Gyro:angle V:vector
@persist 
@trigger all


Me = owner()
Ent = entity()

if (Active == 1)
{
    runOnTick(1)
    P = Ent:elevation(Me:aimPos())
    Y = Ent:bearing(Me:aimPos())
    R = Ent:angles():roll()
    Gyro = -ang(P,Y,R)*500
    
    Ent:applyAngForce(Gyro + $Gyro*5)
    
    V = (Me:aimPos() - Ent:pos())/10
    
    if (W == 1)
    {
        Ent:applyForce(V + $V*5)
    }
    
    
}
(Also, any help optimizing would be great)
 Post #330
 18th February 2010
Gold Member
whosdr's Avatar
July 2008
2,795 Posts
Slash, i'd suggest using a different, more controlled applyForce formula.
E:applyForce(( (TargetPos - E:pos())*20 - E:vel())*E:mass())
 Post #331
 18th February 2010
ryan1271's Avatar
February 2008
360 Posts
Ok, I have a request. To me it seems pretty difficult and time consuming but here goes.

You spawn the E2 at a spot. This is a sensor. When created, it projects a green hologram above a black PHX plate that can be placed any where. This is possibly another E2. The sensor detects NPCs within 200 units (subject to change, possibly changeable by chat command). When the NPC is in range the corresponding hologram turns red. When the NPC is out of range again it turns back to green.

I have the NPC detecting part done.
Code:
@name NPC Detect
@persist Dist Npc:entity Loc:vector

interval(10)

EE = entity()

findByClass("npc_*")
Loc = findClosest(EE:pos()):pos()

Dist = EE:pos():distance(Loc)

if (Dist < 200){
    EE:setColor(255, 0, 0) }
if (Dist > 200){
    EE:setColor(0, 255, 0) }
 Post #332
 18th February 2010 Last edited by Divran; 18th February 2010 at 07:51PM..
Gold Member
Divran's Avatar
April 2008
4,474 Posts
Ok, I have a request. To me it seems pretty difficult and time consuming but here goes.

You spawn the E2 at a spot. This is a sensor. When created, it projects a green hologram above a black PHX plate that can be placed any where. This is possibly another E2. The sensor detects NPCs within 200 units (subject to change, possibly changeable by chat command). When the NPC is in range the corresponding hologram turns red. When the NPC is out of range again it turns back to green.
*stuff*
Wire "Prop" directly to an entity or to an entity marker.
Code:
@name Sensor
@inputs Prop:entity
if (~Prop) {
    holoCreate(1)
    holoMaterial(1,"models/shiny")
    holoParent(1,Prop)

    #Fancy calculations: (if this work it SHOULD place the hologram 25 units ABOVE the prop no matter the size of the prop)
    holoPos(1,Prop:toWorld(Prop:boxCenter()+vec(0,0,Prop:boxSize():z()/2+25))

    runOnTick(1)
}

if (findCanQuery()) { #Are we allowed to find stuff?
    findByClass("npc_*") #Find NPCs
    E = findClosest(Prop:pos()) #Find closest
    if (E:pos():distance(Prop:pos()) < 200) { #Check distance
        holoColor(1,vec(255,0,0)) #Red
    } else {
        holoColor(1,vec(0,255,0)) #Green
    }
}
NOTE: Untested.
 Post #333
 19th February 2010
xxfalconxx's Avatar
March 2009
1,363 Posts
hey divran, quick question. how would i get a hologram spinning without stopping? (using trig just makes it wind and unwind. it's really annoying when you're trying to make a hypnosis beam.)
 Post #334
 19th February 2010 Last edited by Timenova; 19th February 2010 at 08:07AM..
Timenova's Avatar
November 2009
1,079 Posts
hey divran, quick question. how would i get a hologram spinning without stopping? (using trig just makes it wind and unwind. it's really annoying when you're trying to make a hypnosis beam.)
If you are not prepared to use E2, I would suggest a toggled motor/thrusters, it makes my holograms work. I don't think you are making the same type as me though, but...:)
 Post #335
 19th February 2010
Gold Member
whosdr's Avatar
July 2008
2,795 Posts
hey divran, quick question. how would i get a hologram spinning without stopping? (using trig just makes it wind and unwind. it's really annoying when you're trying to make a hypnosis beam.)
curtime() returns the time, and since angles can go over 360 and reset back to 0, curtime() on an angle will make it spin. Multiply it for speed.
 Post #336
 19th February 2010 Last edited by thompy93; 19th February 2010 at 04:04PM..
thompy93's Avatar
February 2010
10 Posts
Could you make a e2 holo map or gpu map (or anything with a screen etc) over rp_downtown_v2.
and make it show players location
i got another one for you.


im working on a security system and it would be cool with a cam that pans to the left and right like a real cam, and if possible add a ranger to it(or something else if that dont work) so the camera stops for 5 secs , sound an alarm and then goes back to pan. i want it to pan almost 180 degrees. not sure yet :P
 Post #337
 19th February 2010
Oppy's Avatar
May 2009
1,269 Posts
Can you make an Expression that moves the entity it is welded to with WASD?

Preferably commented, I'm trying to learn how to use applyForce().
 Post #338
 20th February 2010
Decoy Ocelot's Avatar
March 2009
118 Posts
hey divran, quick question. how would i get a hologram spinning without stopping? (using trig just makes it wind and unwind. it's really annoying when you're trying to make a hypnosis beam.)

Code:
Angle = ang()

holoAng(Index,Angle)

Angle:yaw() += 1

if(Angle:yaw() > 180)
{
    Angle:yaw() = -180
}
More pseudo-code than functional-code, but that should give you a good start for one method of rotating a hologram.
 Post #339
 20th February 2010
Quidsy the Squidsy's Avatar
February 2009
247 Posts
Hey, can someone make me an Expression which makes the chip hover in the air and stay at whatever altitude you put it at? (basically disabled gravity) :D
 Post #340
 21st February 2010
Gold Member
Divran's Avatar
April 2008
4,474 Posts
Hey, can someone make me an Expression which makes the chip hover in the air and stay at whatever altitude you put it at? (basically disabled gravity) :D
Code:
runOnTick(1)
entity():applyForce(vec(0,0,9.013)*entity():mass())
 Post #341
 21st February 2010
Quidsy the Squidsy's Avatar
February 2009
247 Posts
Ok, I'll give that a go. I tried it before with applyForce but i couldn't ever find the right value for the Z vector.

Thanks
 Post #342
 22nd February 2010
zebrak's Avatar
October 2007
388 Posts
A expression2 ghillie suit please.
I Agree A E2 Ghillie Suit would be nice to see. If anyone could make one that would be nice.
 Post #343
 22nd February 2010
Gold Member
Divran's Avatar
April 2008
4,474 Posts
I Agree A E2 Ghillie Suit would be nice to see. If anyone could make one that would be nice.
Not possible unless you can find a material which looks like that. The holo max limit is 50 unless you're admin and change it, and 50 holograms is not enough to make all those leaf-like things.

Plus it would take a long time to get all the positions on the player's body right.

So as I said you'd need a material for it, so that you can use fewer holograms. One on the back, one for each leg and so on.
 Post #344
 22nd February 2010
RQyksopp's Avatar
January 2010
12 Posts
Your holo_radar

Could you moditfy it?
Is it possible to combind it with darkrp?
If so:
cops name are in darkblue, so. Possible to display cops as blue dots on the map? President as a red dot etc?
 Post #345
 23rd February 2010
zebrak's Avatar
October 2007
388 Posts
could it be one of the materials of the bushes and plants
 Post #346
 23rd February 2010
JasonG5's Avatar
December 2009
7 Posts
I was thinking, and kind of have the same question as RQ but different ..
Can you do it so the "owner" of the Holo_radar is coloured something different to the other players, and perhaps for DRP make it show Money printers/entities, and if a person is wanted he will be flashing red, it might be hard so you can perhaps just do the simplest you can, either way take your time :D
 Post #347
 24th February 2010
Decoy Ocelot's Avatar
March 2009
118 Posts
I was thinking, and kind of have the same question as RQ but different ..
Can you do it so the "owner" of the Holo_radar is coloured something different to the other players, and perhaps for DRP make it show Money printers/entities, and if a person is wanted he will be flashing red, it might be hard so you can perhaps just do the simplest you can, either way take your time :D
In the section that creates the holos:

Code:
for(Index=1, Players:count())
{
    holocreate(Index)
}
add a check for the owner and anybody else you'd like to display differently:

Code:
for(Index=1, Players:count())
{
    holocreate(Index)
    if(Players[Index,entity]:SteamID() == "STEAM_targetsteamID")
    {
        #Change holo's color for a particular SteamID
        #You could also modify material, alpha, scale, etc.

        holoColor(Index, vec(Red,Green,Blue)
    }

    if(Players[Index,entity] == entity():owner())
    {
        #same as above but for the owner's hologram
        holoColor(Index, vec(Red,Green,Blue)
    }
}
 Post #348
 24th February 2010
Lambda 77 :D's Avatar
December 2009
496 Posts
I'd like a E2 that allows you to enter a player into a array by typing "!add SteamID " (or name if you can't do that), then make something happen if a entity input is one of the entries in the array.
 Post #349
 24th February 2010
Gold Member
whosdr's Avatar
July 2008
2,795 Posts
I'd like a E2 that allows you to enter a player into a array by typing "!add SteamID " (or name if you can't do that), then make something happen if a entity input is one of the entries in the array.
I do that with player names.
Store it into a table with a number value of 1. If you want to disallow, just set to 0.
I know your here for code, but if you know about E2, use the information above and give it a go.
 Post #350
 27th February 2010
JasonG5's Avatar
December 2009
7 Posts
In the section that creates the holos:

Code:
for(Index=1, Players:count())
{
    holocreate(Index)
}
add a check for the owner and anybody else you'd like to display differently:

Code:
for(Index=1, Players:count())
{
    holocreate(Index)
    if(Players[Index,entity]:SteamID() == "STEAM_targetsteamID")
    {
        #Change holo's color for a particular SteamID
        #You could also modify material, alpha, scale, etc.

        holoColor(Index, vec(Red,Green,Blue)
    }

    if(Players[Index,entity] == entity():owner())
    {
        #same as above but for the owner's hologram
        holoColor(Index, vec(Red,Green,Blue)
    }
}



Im pretty much new to E2, so could you put that code with the holo_radar code into a working one, since i tried and failed :/
 Post #351
 27th February 2010 Last edited by Decoy Ocelot; 27th February 2010 at 03:37PM..
Decoy Ocelot's Avatar
March 2009
118 Posts
Replace STEAM_XXXXXXX with someone's SteamID. You can get a list of all the players' ID's by typing "status" in console. Replace Red,Green,and Blue with the color values of your choice, where 0,0,0 is black, 255,255,255 is white, 255,0,0 is red, etc etc.

Also, this particular chip only runs a find on its first execution. If players join or leave the game, you'll need to either re-place or re-upload the e2 chip for it to properly update its player list.

Code:
@name Hologram Radar
@persist Players:array Scale


if(first())
{
    #find all players
    findByClass("player")
    Players = findToArray()
    
    #spawn holograms for each player
    for(Index=1,Players:count())
    {
        holoCreate(Index)
        holoModel(Index,"hqicosphere")
        holoScale(Index,vec(0.5,0.5,0.5))
        holoMaterial(Index,"models/debug/debugwhite")
        
        #check for custom colors

        #owner
        if(Players[Index,entity]:steamID() == owner():steamID())
        {holoColor(Index,vec(Red,Green,Blue))}
        
        #player name
        if(Players[Index,entity]:steamID() == "STEAM_XXXXXXXXX")
        {holoColor(Index,vec(Red,Green,Blue))}
        
    }
    
    #black background
    holoCreate(0)
    holoModel(0,"plane")
    holoScale(0,vec(40,40,1))
    holoColor(0,vec())
    holoAlpha(0,100)
    holoMaterial(0,"models/debug/debugwhite")
    
    runOnTick(1)
}

#move holograms
holoPos(0,entity():pos() + vec(0,0,5))

for(Index=1,Players:count())
{
    holoPos(Index,entity():pos() + entity():toLocal(Players[Index,entity]:pos()) / vec(60,60,20) + vec(0,0,10))
}
It's pretty easy to add more players to your list; just copy/paste these two lines:

Code:
 
#player name
if(Players[Index,entity]:steamID() == "STEAM_XXXXXXXXX")
{holoColor(Index,vec(Red,Green,Blue))}
Make sure you place it inside the
Code:
if(first())
block, though; you only need to set each holos' color once, rather than every tick.
 Post #352
 27th February 2010
Finlander's Avatar
June 2009
55 Posts
Hey, I have a request for an E2.

However, it's not an actual code: It's an addition to another code. To be exact, this code:

applyAngForce: (Easy)
Code:
@name applyAngForce Turret
@inputs On [Turret Chair]:entity
@persist Ang:angle
@trigger
runOnTick(On)
if (On) {
    Pos = Chair:driver():aimPos()
    Ang = -ang(Turret:elevation(Pos),Turret:bearing(Pos),Turret:angles():roll()) * 1000 #You will have to change 1000 for different props.
    Turret:applyAngForce(Ang+$Ang*5)
}
This code is the mouse-aimed turret for a request that you fulfilled in page 2. There's an addition I would like to make, but I can't, since I can't the wiring.

Basically, give it some code that makes the thing completely ignore some props. That is to say, if I look at a prop, the turret doesn't look at the prop, but instead acts as if the prop wasn't there at all. So if I, for example, look at a PHX plate that it's supposed to ignore, and there's another prop behind it, the turret looks at the prop behind the PHX plate.

If that doesn't work out, make the turret ignore ALL of my props.

If THAT doesn't work out, OH SHIT!!!!
 Post #353
 27th February 2010 Last edited by JasonG5; 27th February 2010 at 09:27PM.. (Added something)
JasonG5's Avatar
December 2009
7 Posts
Replace STEAM_XXXXXXX with someone's SteamID. You can get a list of all the players' ID's by typing "status" in console. Replace Red,Green,and Blue with the color values of your choice, where 0,0,0 is black, 255,255,255 is white, 255,0,0 is red, etc etc.

Also, this particular chip only runs a find on its first execution. If players join or leave the game, you'll need to either re-place or re-upload the e2 chip for it to properly update its player list.

Code:
@name Hologram Radar
@persist Players:array Scale


if(first())
{
    #find all players
    findByClass("player")
    Players = findToArray()
    
    #spawn holograms for each player
    for(Index=1,Players:count())
    {
        holoCreate(Index)
        holoModel(Index,"hqicosphere")
        holoScale(Index,vec(0.5,0.5,0.5))
        holoMaterial(Index,"models/debug/debugwhite")
        
        #check for custom colors

        #owner
        if(Players[Index,entity]:steamID() == owner():steamID())
        {holoColor(Index,vec(Red,Green,Blue))}
        
        #player name
        if(Players[Index,entity]:steamID() == "STEAM_XXXXXXXXX")
        {holoColor(Index,vec(Red,Green,Blue))}
        
    }
    
    #black background
    holoCreate(0)
    holoModel(0,"plane")
    holoScale(0,vec(40,40,1))
    holoColor(0,vec())
    holoAlpha(0,100)
    holoMaterial(0,"models/debug/debugwhite")
    
    runOnTick(1)
}

#move holograms
holoPos(0,entity():pos() + vec(0,0,5))

for(Index=1,Players:count())
{
    holoPos(Index,entity():pos() + entity():toLocal(Players[Index,entity]:pos()) / vec(60,60,20) + vec(0,0,10))
}
It's pretty easy to add more players to your list; just copy/paste these two lines:

Code:
 
#player name
if(Players[Index,entity]:steamID() == "STEAM_XXXXXXXXX")
{holoColor(Index,vec(Red,Green,Blue))}
Make sure you place it inside the
Code:
if(first())
block, though; you only need to set each holos' color once, rather than every tick.


Woow ! Thanks a lot :"D

Now can this be combined with RP ? So Gundealers are orange, president = red, Or perhaps provide me with one line of code that I can copy and paste and edit to fit our Server's custom jobs :D


_____
Edit
____

Sorry another thing

the line


holoModel(Index,"models/Humans/Group01/male07.mdl")


How come it turns square ? Cant i make the holo's a player model, or a prop model ? instead of just a sphere :/
 Post #354
 28th February 2010
Gold Member
Divran's Avatar
April 2008
4,474 Posts
Sorry another thing

the line


holoModel(Index,"models/Humans/Group01/male07.mdl")


How come it turns square ? Cant i make the holo's a player model, or a prop model ? instead of just a sphere :/
You need the custom E2 function called "holoModelAny" for that.

But rumor has it that holoModel will soon be able to use any model... it's just that work on that is going very slowly. :S
 Post #355
 28th February 2010
jrod's Avatar
December 2009
14 Posts
hey divran can u make me a "predator" e2 where it holocreats a plane with a camera that i can adjust and then i can wire it up to a chair and a screen
 Post #356
 1st March 2010
Northy66's Avatar
July 2008
310 Posts
Is it possible for you to create an E2 or LUA script that can do the same lines along status, that lists their Steam Friends names, and their names if they were on an RP server and had set RP names?
 Post #357
 2nd March 2010
zebrak's Avatar
October 2007
388 Posts
hey divran can u make me a "predator" e2 where it holocreats a plane with a camera that i can adjust and then i can wire it up to a chair and a screen
Now that would be cool to see
 Post #358
 2nd March 2010
Quidsy the Squidsy's Avatar
February 2009
247 Posts
Hey, is it possible to make an expression code which finds the world coordinates of all cameras owned by the entity i give it?
 Post #359
 2nd March 2010 Last edited by whosdr; 2nd March 2010 at 07:57PM..
Gold Member
whosdr's Avatar
July 2008
2,795 Posts
Hey, is it possible to make an expression code which finds the world coordinates of all cameras owned by the entity i give it?
Yes, yes it is.
If I knew the camera entity I would code it.

Edited:

Code:
@inputs E:entity
@persist Array:array
interval(10000) #search every 10 seconds
findIncludePlayerProps(E) #only this players props
findByClass("") #camera entity here
Array = findToArray() #put it into an array

for (X = 1,Array:count()) {
	holoCreate(X) #create a hologram
	holoPos(X,Array[X,entity]:pos()) #position a hologram
	holoParent(X,Array[X,entity]) #parent it to the camera
	print("Camera "+X+" is at vector " + Array[X,entity]:pos():toString()) #print it - don't run on small intervals
	concmd("echo Camera "+X+" is at vector " + Array[X,entity]:pos():toString()) #put it into console
}
Next page ->
 Post #360
 2nd March 2010 Last edited by Quidsy the Squidsy; 2nd March 2010 at 07:54PM..
Quidsy the Squidsy's Avatar
February 2009
247 Posts
Yes, yes it is.
If I knew the camera entity I would code it.
Oh ok, cool. Does anybody know what the camera entity is?

Edited:

Thanks for that code! So how will i find out the camera entity? :(
Reply

All times are GMT. The time now is 06:21AM.

Facepunch Studios 2010 - Server 'MARGE'