Spawn Items

EliasF

Sorrowing
21.09.2019 03:49:31Link to post

I sincerely don't know nothing about programation but I want to find an function to spawn items.
Something like this:

function XSetup.PowerStruggle.multiplayer_ps_refinery.OnNewMap(mapRules, mapName)

LogAlways("[PGCX] Spawning Custom Vehicles for Map.");
XAddEntity(
{
class = "GaussRifle";
name = "GaussRifle";
orientation = { x=0, y=0, z=160 };
position = { x=2654.547, y=2556.16, z=420.9594 };
properties = {
Modification = "GaussRifle";
Respawn = {
bAbandon = 1;
bRespawn = 1;
bUnique = 1;
nAbandonTimer = 5;
nTimer = 5;
};
};
} );

XSetup.PowerStruggle.unknown.OnNewMap(mapRules, mapName);
end

I used this from a old Xastrada.lua
My question is if something like this already exists?
And sorry for my ignorance


Zi;

Every man is the architect of his own fortune.
21.09.2019 08:49:36Link to post

Modify it as follows

AddFunc(function()
	local map = GetMapName()
	if map == "multiplayer/ps/refinery" then
		System.SpawnEntity({
			class = "GaussRifle";
			name = "GaussRifle";
			orientation = { x=0, y=0, z=160 };
			position = { x=2654.547, y=2556.16, z=420.9594 };
			properties = {
				Modification = "GaussRifle";
				Respawn = {
					bAbandon = 1;
					bRespawn = 1;
					bUnique = 1;
					nAbandonTimer = 5;
					nTimer = 5;
				};
			};
		});
	end
end, "PrepareAll")



EliasF

Sorrowing
21.09.2019 21:16:19Link to post

Which file I should write this?


Comrade

22.09.2019 16:43:37Link to post

Create new file (for example LevelSetup.lua) in AdditionalScripts folder and paste Zi's code there. Then restart server or just reload scripts with !reloadscripts chat command (or sfw_reloadscripts command in server console).


EliasF

Sorrowing
22.09.2019 23:19:38Link to post

It works but I have problems when write the orientation values like this

In the Editor the values are 0 but in the .lua created has different result with the same value as you see in the game


So to match orientation, the value become this


And I must write to other axis (or axle. Sorry my english)
Is this a bug?


Freebo

23.09.2019 16:32:35Link to post

YES It was always like that.

At least since 2014 - I always had to correct every object for 90 degrees :) Sometimes for 350 objects on the map - but I was doing that on default so it became normal :) Like remmebering that 90 means 0 - and so on :)

Most of the time server side buildings like those here in early 2014 - during GameSpy times:

...

You will get used to it - or you can write some cript for that (ask someone) to change those 90 degrees automatically for you if you wish.


Obviously can be done also in leveldesigner code directly - probably Zi would be able to fix it - but I'm not sure it's needed to work on that. Especially if it destroys previous works on server side :)

Seriously - changing 90 degrees manually in the lua code worked for me, even though I had to apply it probably around 1000 times across all maps - but I always do it the "hard way" instead of using help of the scripts and comfortable techniques. I'd call it "the dumb way" :) I'm a minimalist.

But you're right about that.
I alredy forgot - thanks for reminding ;) I don't build server side maps anymore - since they are ready and on-line - I didn't remember about that 90 deg. problem for last 3 years.

It's good you've mentioned that.
Maybe you will receive a solution and it will be fixed for the future works for everybody.


EliasF

Sorrowing
23.09.2019 22:21:39Link to post

I knew it so in the 2014 i started to calculate the values to match and I wrote something to don't forget in the future return.
I made this in 2013 at school.




Freebo

23.09.2019 23:34:59Link to post

Haha. Those screens of notes and calculations from 2013 are just amazing :) Seriously !!!

I would never do so much calculations on that subject. Just adding, testing on server and adjusting to fit the need :) Yeah takes a time but good for code dummies like myself. I'm too lazy to make notes even on mods I make - then I don't remember all ways I went through to invent things. And then after years I need hours to figure out how I made them ;) Even though when I was making them it was like hundreds of hours - but after it's done and on-line - all the background effort goes away and I don't think about it.

So you're the boss man with those calculations.
Anyway - that 90 degree problem stays on board. You can call it a bug though. But you know how to deal with it - so everything is fine ;)

Thanks again for those photos. Really Great stuff.

PS: And obviously it was all about spawning the Flag in those old days :) But because since 2013/2014 we could spawn any object - we could finally forget about weapons, vehicles and flags as the only things to spawn :) As a "mapper" I wanted to spawn objects on server side since 2010 - I wanted it so bad I was doing my own stupid experiments without any results :) - but before 2013/2014 only flags were spawnable as "objects" - which was not enough - so I've started alredy when real objects were possible to apper on server side 2013/2014. Luckily I could forget about drawing and calculating just that useless flag :)

And again - new Leveldesigner is amazin thing for both map designers (who don't want to create downloadable maps) and for admins who give players the opportunity to build things on server in real time. Unfortunately - it's not being used too much nowadays. If we could have it in 2010/2011 - during mid GameSpy times - that would be really something. A huge game changer before map-autodownloader. 2013/2014 was a bit too late for both those inventions - but still - imagination is the limit and leveldesigner still has a future here :)

Thanks a lot man. It's nice to see people who still care and take care of every detail. Trust me 99,99% of Crysis players doesn't care about any creation or putting effort into production of original stuff and ideas. I knew less than 10 who would invest free time to add something to the game during last 5 years - and then they could even join and play it with others. Just imagine 100 people like that nowadays. No limits :)

Respect for your involvement. Enjoy and have fun with it.


EliasF

Sorrowing
14.10.2019 04:17:18Link to post

Hey there I have a new question. How I can spawn cloaked things? It's possible?



misterSD

Crysis player & modder
14.10.2019 09:11:25Link to post

No idea, but now that you noticed me the existence of this, I will do some search.

Page: 1 2 


CryMP.Net - 2019 - service rules
 
We support only LEGAL VERSION of CRYSIS. We DO NOT RESPECT CRACKING, HACKING, INSULTING and actions against COPYRIGHTS or FAIR PLAY.