Player specific Spawning help

Place for sharing your game modifications for Life is Feudal: Your Own

Everettham
Alpha Tester
 
Posts: 56
Joined: 22 Apr 2014, 02:16

Player specific Spawning help

Post by Everettham » 05 May 2016, 04:04

This is copy and pasted from another thread. I'm trying to figure out how to do this through SQL.

"I think if you want the players to RESPAWN at the specific location when they die, until they bind a new bind point, you can place an item such as a fountain in a neutral city (ObjectID = 96), look it up in the unmovable_objects table and note its unique item ID (example, 12345), then you can add "Set New.BindedObjectID = 12345;" to your trigger:"


Code: Select all
delimiter $$
CREATE TRIGGER `t_set_first_spawn` before INSERT ON `character` FOR EACH ROW BEGIN
set New.GeoID = 117052637;
set New.GeoAlt = 5100;
set New.BindedObjectID = 12345;
END;
$$


MacDante
 
Posts: 95
Joined: 12 May 2015, 10:08

Re: Player specific Spawning help

Post by MacDante » 05 May 2016, 12:25

it simple, copy SQL from DELIMITER to $$ and paste in Query in HEIDI SQL, and run QUERY.

But porblem is with QUERY this QUERY (trigger) can run only one when player create CHARACTER.

Code: Select all
delimiter $$
CREATE TRIGGER `t_set_first_spawn` before INSERT ON `character` FOR EACH ROW BEGIN
set New.GeoID = 117052637;
set New.GeoAlt = 5100;
set New.BindedObjectID = 12345;
END;
$$


If You Want force spawn after DIE or pray you should use diffirent condition :)

Code: Select all
delimiter $$
CREATE TRIGGER `t_set_death_spawn` BEFORE UPDATE ON `character` FOR EACH ROW BEGIN

-- option set pawn point like character binded object:
   SET @spawnPoint = (SELECT BindedObjectID FROM `character` ch WHERE ch.ID = NEW.ID);
      set New.RallyObjectID = @spawnPoint;
       
       -- or to specyfic unmobable object like monument in top mountain
set New.RallyObjectID = XXX;
         
END
$$

where XXX is a ID from DB table UNMOVABLE_OBJECTS.


Everettham
Alpha Tester
 
Posts: 56
Joined: 22 Apr 2014, 02:16

Re: Player specific Spawning help

Post by Everettham » 05 May 2016, 23:09

This is what I put in Query Directed at databse lif_2. Then I clicked run Query. I'm using object ID 166 which is a Lamp Post as the spawn point. Before activating the trigger I created a Lamp Post in game. But whenever I run the trigger and then start the server. I get (1024) character creation error.


delimiter $$
CREATE TRIGGER `t_set_death_spawn` BEFORE UPDATE ON `character` FOR EACH ROW BEGIN

-- option set pawn point like character binded object:
SET @spawnPoint = (SELECT BindedObjectID FROM `character` ch WHERE ch.ID = NEW.ID);
set New.RallyObjectID = @spawnPoint;

-- or to specyfic unmobable object like monument in top mountain
set New.RallyObjectID = 166;

END
$$


MacDante
 
Posts: 95
Joined: 12 May 2015, 10:08

Re: Player specific Spawning help

Post by MacDante » 06 May 2016, 07:27

you sure 166 is ID of this object ? looks like is wrong ID and trigger cant confirm operation.

166 is ID of LAMP POST,
you must write ID from UNMOVABLE_OBJECT where lamp post is added

try make QUERRY in DB:

Code: Select all
select * from unmovable_objects where ObjectTypeID=166 order by ID DESC

highest ID from list records should be probably ID which you should put to trigger i XXX place.

Code: Select all
delimiter $$
CREATE TRIGGER `t_set_death_spawn` BEFORE UPDATE ON `character` FOR EACH ROW BEGIN

set New.RallyObjectID = XXX;

END
$$


Catherine
 
Posts: 31
Joined: 01 Mar 2016, 10:00

Re: Player specific Spawning help

Post by Catherine » 07 May 2016, 18:33

it aint working for me, do we have to restart the server ?

Return to Game mods

cron