Jump to content

AggrorJorn

Members
  • Posts

    4,816
  • Joined

  • Last visited

Everything posted by AggrorJorn

  1. I've made a projector spotlight for you. Place the map with the other lights and drag a projector-spotlight on screen. The only thing you need to do is replace the "projector-map.dds", with your own dds file if you want to. Be sure to give it the same name though. 27 december update: The new 2.3 sync changes the lua a bit. 3 replies lower is the new file.
  2. can you show what you have? I'm interested in how much it differs from what I have. perhaps this way I can find something that solves the problem.
  3. The problem is (I think) that the key doesn't refresh as it is in the loop. I build a menu to check if you want an icon to appear. however when you set a key, you don't check wether the value in the menu is true or false. I used this approach (with a lot of help from Rick). switch.lua : fpscontroller.lua: --check hand icon pick=CameraPick(camera,Vec3(GraphicsWidth()/2,GraphicsHeight()/2,2.0),0,0) if pick~=nil then -- show hand icon if (GetEntityKey(pick.entity,"showhand","yes")==true) then handIcon = true end else handIcon = false end But it's not working correctly. Sometimes it works but not always.
  4. Macklebee: Are you able to show the hand icon just on the switch only? I've been strugling with that for a week. I manage to show the image with raycast but I can't make it so, that it only appears on specified objects (like just the switch.) Rick: I tried to make a simple flat plane with a texture and alpha on it, but the effects really ugly. When you stand in the volume ligt you are sort of in the plane and you will see the the edge of the plane going through your screen.
  5. So true. Another thing that would be great to use this with is placeable Volume lights. This way you can place several billboars on screen creating volume light and you have more controll over it. on 3:30 in this movie you see how this works. You have to freeze there though because it goes really fast.
  6. Thanks for your help. It's really appreciated.
  7. I don't think I'm going to solve this any time soon. The logic seems to slip away at some points. I guess I have to wait for some tutorials/ Is there another way to check via pick.entity what kind of model it is? Like say: the pick.entity returns a model name or something?
  8. using if (GetEntityKey(pick.entity,"switchIcon","true")) then results in no errors, but the icon appears on every single model. If I try if (GetEntityKey(pick.entity,"switchIcon","true"))== true then then the hand icon doesn't appear. So it looks like the command is right now, but it doesn't refer to the right key. Also this code seems quite fragile as the editor crashes with the smallest of change.
  9. I though that 'model' was some kind of global class. --check hand icon pick=CameraPick(camera,Vec3(GraphicsWidth()/2,GraphicsHeight()/2,2.0),0,0) if pick~=nil then repeat if pick.entity:GetClass()==ENTITY_MODEL then break end pick.entity=pick.entity.parent until pick.entity==nil -- show hand icon if (GetEntityKey(model,"switchIcon","true"))== true then handIcon = true end else handIcon = false end In a previous topic I wondered if I could change "GetClass()==ENTITY_MODEL " could change into my own kind of class. But this ways seemed the better solution to this.
  10. I forgot to reply here. Yeps, that did the trick! thanks
  11. no it's in the main loop. It's deffinetly the code in the fps that crashes the engine. I''l have another look tomorrow
  12. I have to be close then: switch.lua group=grid:AddGroup( 'Icon' ) group:AddProperty( 'showicon', PROPERTY_BOOL,'', 'Show hand icon' ) group:Expand(1) end function SetKey(model,key,value) if key=='showicon' then SetEntityKey(model,"switchIcon","true") end end the fpscontroller: -- show hand icon if (GetEntityKey(model,"switchIcon","true")) then handIcon = true end The engine crashes entirely when I approach the switch.
  13. That was just a typo in the topic. It is "entity.model'. If I look at the base script and the camera nodes scripts, it seems that this tactic should be working. I'll have another look.
  14. hmm Although I'm more clear about what the SetKey does, it's not entirely clear where to put them exactly. This is the menu option. group:AddProperty( "showicon",PROPERTY_BOOL,"","Show hand icon") I've added this to the spawn function : function Spawn(model) model:SetKey("showicon","1") This way when a new switch is being dragged on, it has a default value of 1 (true). Next there is the function SetKey(model,key,value). I've place a new model.setkey command but here I get an error. function SetKey(model,key,value) entitymodel:SetKey("showicon","true") The error message "attempt to index global 'entitymodel' (a nill value)". What does this error mean exactly?
  15. OK, I'll wait for that. for me it will be tomorrow because of the time difference.
  16. I'll be looking in to that then. It's isn't a problem to create a few bones btw. However if you have an example of how you prefer it, please send it to me. (an image with the bone placements and names would suffice. I work in 3ds Max) That way I can better understand how you want the weapons to be structured with bones.
  17. I''l give it a try when I'm back at home (which will be tomorrow). Thx for the reply
  18. I've made this extra menu for the switch moddel. You can select true or false. --hand icon menu group=grid:AddGroup( "Hand icon" ) group:AddProperty( "Show hand icon", PROPERTY_BOOL ) My question is: How can I retrieve the selected value in the menu, outside the script where I created the menu?
  19. I'll make a new topic for this, as the question is now different.
  20. Making this post probably alone was a lot of work already. If you get this to work, it would be outstanding! Do you need weapons of any kind? I would be happy to help you with that.
  21. I think this is all a litlle bit above me. I think I''ll wait for some tutorials about this. Thanks for your help, I apprecate it.
  22. We could use a tutorial forum, like the old forum. If someone has a tutorial or an instructions he can post it there.
  23. I'm not 100% sure how to use the SetKey and GetKey functions. I have the following in the switch.lua: --hand icon menu group=grid:AddGroup( "Hand icon" ) group:AddProperty( 'Show hand icon', PROPERTY_BOOL,'showicon') function SetKey(model,key,value) if key=="showicon" then entity.pickable=tonumber(value) end return 1 end Is 'showicon' in AddProperty the Key here? In the FPScontroller I use a raytrace: pick=CameraPick(camera,Vec3(GraphicsWidth()/2,GraphicsHeight()/2,2.0),0,0) if pick~=nil then repeat if pick.entity:GetClass()==ENTITY_MODEL then break end pick.entity=pick.entity.parent until pick.entity==nil -- show hand true or false if pick.entity~=nil then ????GetKey("showicon","true") handIcon = true end else handIcon = false end At the question marks I need to retrieve if the value is true or false from 'showicon' in the switch.lua. As I understand this is done by the GetKey.
  24. hmm, didn't think of that, nice one. For the first time I used a LUA menu style for this (getting a menu option makes it look really professional ) --hand icon menu group=grid:AddGroup( "Hand icon" ) group:AddProperty( "Show hand icon", PROPERTY_BOOL ) this code was added to the switch.lua. If I want to retrieve the state of the bool value from the FPS Controller script, do I have to use the GetKey and Setkey commans for this?
×
×
  • Create New...