Post anything here that does not fall into the other topic categories.

is it possible?

is it possible?

Postby lordalmighty1 » 26 Jul 2015, 10:29

hi sp/starfire.
is it possible do you think to go from fps controller to say the monster truck controller and back to fps controller again with a press of a keyboard button please?. (like f to enter vehicle mode when near a vehicle)
working on something and I would very much like to run around shooting zombies then jump into the monster truck and drive around abit b4 going back to the shooting.
im guessing yes but with some form of special coding being needed for that to happen?.
also how to change the speed of vehicles please? is that in the script for them?, couldn't find it in properties like the fps player.


on a side note, having issues with vehicles not driving on terrain right now. they drive ok on the roads but when leaving the road the screen goes all green :S. fps player works fine on terrain though
User avatar
lordalmighty1
Skyline Moderator
Skyline Moderator
 
Posts: 442
Joined: 02 Jan 2014, 12:13
Location: uk
Skill: Great creative
Skill: Level Designer

Re: is it possible?

Postby epsilonion » 26 Jul 2015, 10:56

I need this for my project as well, was thinking about a collision box around a car so when player enters it and presses the e key only then he can enter the car, from there deactivate the fps controller and activate the car controller, not at my computer atm sort of thing like the splash screen thing I did with the viSible not visible option but with active on the fps and car controller..

That's the way I have come up with it just sat here watching TV lol..
User avatar
epsilonion
Skyline Lead Moderator
Skyline Lead Moderator
 
Posts: 874
Joined: 26 Feb 2015, 11:51
Location: Hull, East Yorkshire, England
Skill: Business Manager
Skill: Great creative

Re: is it possible?

Postby epsilonion » 26 Jul 2015, 11:00

Just not sure how to parent the car so the trigger box is the child so it moves with the car....
User avatar
epsilonion
Skyline Lead Moderator
Skyline Lead Moderator
 
Posts: 874
Joined: 26 Feb 2015, 11:51
Location: Hull, East Yorkshire, England
Skill: Business Manager
Skill: Great creative

Re: is it possible?

Postby lordalmighty1 » 26 Jul 2015, 11:07

yeah would be cool to have it somehow :)
User avatar
lordalmighty1
Skyline Moderator
Skyline Moderator
 
Posts: 442
Joined: 02 Jan 2014, 12:13
Location: uk
Skill: Great creative
Skill: Level Designer

Re: is it possible?

Postby ant0N » 26 Jul 2015, 11:08

I think that this is easy to do with lua
Sorry for my English. :)
User avatar
ant0N
Skyline Moderator
Skyline Moderator
 
Posts: 415
Joined: 02 Nov 2012, 12:49
Location: Россия, Москва
Skill: Programmer
Skill: 3D Modeller

Re: is it possible?

Postby lordalmighty1 » 26 Jul 2015, 11:10

I don't doubt it anton m8, im just not a coder lol. :( I really should take the time to learn some lua it just makes me nervous and alittle afraid haha..
User avatar
lordalmighty1
Skyline Moderator
Skyline Moderator
 
Posts: 442
Joined: 02 Jan 2014, 12:13
Location: uk
Skill: Great creative
Skill: Level Designer

Re: is it possible?

Postby epsilonion » 26 Jul 2015, 11:12

Will Google parenting in lua later get some ideas, I was looking up parsing text files and splitting with a delimiter but couldn't get it working in the editor, spent all night looking that up, wanted to load in to arrays for monsters, health, damage etc at the beginning of a game.. then realised will have to do that on every level so scrapped it..
User avatar
epsilonion
Skyline Lead Moderator
Skyline Lead Moderator
 
Posts: 874
Joined: 26 Feb 2015, 11:51
Location: Hull, East Yorkshire, England
Skill: Business Manager
Skill: Great creative

Re: is it possible?

Postby ant0N » 26 Jul 2015, 11:14

if you leave me your scene with the car, I'll try to do it :)
Sorry for my English. :)
User avatar
ant0N
Skyline Moderator
Skyline Moderator
 
Posts: 415
Joined: 02 Nov 2012, 12:49
Location: Россия, Москва
Skill: Programmer
Skill: 3D Modeller

Re: is it possible?

Postby epsilonion » 26 Jul 2015, 11:14

Me Lord. .... ☺

Google is you're best friend lots of examples out there for everything, I am learning lua aswell it's been over 15 years since I did any programming (shit that's a long time) lol...
User avatar
epsilonion
Skyline Lead Moderator
Skyline Lead Moderator
 
Posts: 874
Joined: 26 Feb 2015, 11:51
Location: Hull, East Yorkshire, England
Skill: Business Manager
Skill: Great creative

Re: is it possible?

Postby TattieBoJangle » 26 Jul 2015, 11:18

not sure parenting would be the best way removing/spawning the player so when at the car and "e" is pressed played is removed and when you stop the car and "e" is pressed player is spawned at the cars location I could be wrong ;)
Case: CM Storm Trooper CPU: I7 5930k X99 Cooler: Noctua NH-D15 Graphics: Asus GTX 1080 Motherboard: Rampage Extreme V x99 Ram: RipJaws DDR4 3000mhz Storage: x2 SSD Crucial 500GB + x5 2TB Hdd PSU: Evga 1500w OS: Windows 10
User avatar
TattieBoJangle
Community Manager
Community Manager
 
Posts: 858
Joined: 26 Jan 2015, 00:15
Location: United Kingdom
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer
Skill: Great creative

Re: is it possible?

Postby lordalmighty1 » 26 Jul 2015, 11:24

15 yrs yeah tell me about it m8, I wrote a song for my game idea (not very good song at that) and its been about the same amount of time since my old singer song writer days lol.. kinda nostalgic haha, though I was never very good at it back then either lol.

as for google I find only ways to print 1 5 times over on the same line lol. im not very good at searching I guess :(.
I did do a unity tutorial for about 3 days in c~ or c++ whatever it is unity uses and failed at that lol.. im just not to clever I guess even at copying from a tut like lol.. but thanks m8 :)
User avatar
lordalmighty1
Skyline Moderator
Skyline Moderator
 
Posts: 442
Joined: 02 Jan 2014, 12:13
Location: uk
Skill: Great creative
Skill: Level Designer

Re: is it possible?

Postby SolarPortal » 26 Jul 2015, 11:44

you could even do it without a trigger box and instead use a raycast, check the distance to the car. If the distance is less than a couple of meters or units then show press e and if pressed, enter the car.

This is one of those mechanics we have wanted to do for some time.

Googling attachments in lua won't help too much as the code used is specific to skyline.
Since all attachments are is a simple position / orientation to the target entity. You can probably even use a similar code to the one i just wrote out for cosmo recently, and use the physics.setTriggerPosition() and physics.setTriggerOrientation() if you are using trigger boxes.

As for character animations of getting in / out a car, well i have never tried to do this yet lol :P

For the FPS, maybe just turn the actions off and reposition under the ground until you exit the vehicle which is when you would reengage the actions and set the position to the place where you exit the vehicle. All smoke and mirrors :)

@antON, i look forward to seeing some of your tests :)
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: is it possible?

Postby epsilonion » 26 Jul 2015, 11:57

I think using raycast is the way to go... just have to work them out lol...
User avatar
epsilonion
Skyline Lead Moderator
Skyline Lead Moderator
 
Posts: 874
Joined: 26 Feb 2015, 11:51
Location: Hull, East Yorkshire, England
Skill: Business Manager
Skill: Great creative

Re: is it possible?

Postby epsilonion » 26 Jul 2015, 12:00

float entity::getDistance ( int objectID,
int TargetID
)

Maybe
User avatar
epsilonion
Skyline Lead Moderator
Skyline Lead Moderator
 
Posts: 874
Joined: 26 Feb 2015, 11:51
Location: Hull, East Yorkshire, England
Skill: Business Manager
Skill: Great creative

Re: is it possible?

Postby lordalmighty1 » 26 Jul 2015, 12:08

ok so it is possible thanks :)

another question though..
I want to have say alot of zombies placed on the map, then have them be respawn after x amount are gone. something like 6 placed then 3-5 respawn say 3-5 more times over each, after so many are gone and on a timer and spread over the map.
to simulate repopulation of roaming zombies in a city and to simulate them trying to find the gun fire sounds. is it possible to have respawners for ai,boxes of ammo, and such?. probably a silly question lol im full of them haha.

so in short can I respawn x amount of zombie x amount of times in say a certain zones?.
User avatar
lordalmighty1
Skyline Moderator
Skyline Moderator
 
Posts: 442
Joined: 02 Jan 2014, 12:13
Location: uk
Skill: Great creative
Skill: Level Designer

Re: is it possible?

Postby SolarPortal » 26 Jul 2015, 12:23

Yes, it is all possible but would need to be programmed.
You could just create a preset of your zombie with scripts and all then simple call entity.spawnPreset() to spawn a new zombie that has physics, scripts etc... then all that needs programmed is the respawn point.

Maybes store a global variable of the amount of zombies for area 1, 2, 3, 4 etc that already created, and when that number drops because you killed a zombie, spawn a new zombie. Each zombie can store its own id from which area it was created.

My only concern would be the amount you create per frame. Too many spawns in a single frame can cause a pop.
So you would need to spawn say 1 or 2 per frame until they are filled up and stop spawning, this makes a smooth game and no one will notice things happening over a few frames.

Code: Select all
-- respawn point rough code -- not copyable but gives you the idea
obj = -1;
function onInit(objID)
   obj = objID;
   -- start timer on 100ms or something to keep the frames fast as every frame is not required
end

function onTimer() -- not actual function,, again this is rough
   if(numZombies < maxSpawnAmount)then
      -- spawn a zombie into the scene
      id = entity.spawnPreset("zombie") -- and all other properties
      -- call function in zombie script and set area id.
   end
end


@liam, you could use this but it would be very expensive. Using a raycast would be better as an FPS will need one already for certain mechanics like pressing switches etc.. so it would need a simple
Code: Select all
-- rough code, not copyable all from head
function onUpdate(td)
   hitID = physics.rayFromPoint() -- or whatever command
   if(hitID ~= -1)then
      if( hitID == switchID )then
          -- open door -- trigger explosions etc...
      end

      if( hitID == VehicleID )then
          -- get distance from ray not using the getDistance function
                         if(distance < 2)then
                              -- get in car
                         end
      end
   end
end
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: is it possible?

Postby TattieBoJangle » 26 Jul 2015, 12:30

I did do a spawn script over on le***ks but for the love of me I couldn't cant get it to work here lol I will look it out later and try again ;)
Case: CM Storm Trooper CPU: I7 5930k X99 Cooler: Noctua NH-D15 Graphics: Asus GTX 1080 Motherboard: Rampage Extreme V x99 Ram: RipJaws DDR4 3000mhz Storage: x2 SSD Crucial 500GB + x5 2TB Hdd PSU: Evga 1500w OS: Windows 10
User avatar
TattieBoJangle
Community Manager
Community Manager
 
Posts: 858
Joined: 26 Jan 2015, 00:15
Location: United Kingdom
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer
Skill: Great creative

Re: is it possible?

Postby StarFire » 26 Jul 2015, 13:35

@LA the new Lua blog lessons will really help you. If you can stick with them I will get you to have confidence with Skylines Lua. ;)

Once The lessons get into the practical area may be we can then cover simple user solutions such as the spawning and raycasting etc. :D
Dream the Journey, Live the Experience!
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: is it possible?

Postby lordalmighty1 » 26 Jul 2015, 14:37

lol, I will try starfire :). thanks
User avatar
lordalmighty1
Skyline Moderator
Skyline Moderator
 
Posts: 442
Joined: 02 Jan 2014, 12:13
Location: uk
Skill: Great creative
Skill: Level Designer


Return to Misc

Who is online

Users browsing this forum: No registered users and 2 guests

cron